Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to make if with two statments?

Hey, I want to make something like that:
(if: $gold_coins > 5 and $number_health_potion > 0)

with different else outcomes, how can it be done?
If you have more than 5 gold coin, you buy the health potion, and it check if there is health potion at all.
if you don't have enough money, it will print "you dont have money", and if there are no health potions, it will print "I don't have health potions".
I just don't know how to make it work, I spent the whole day tring to make it work.

Comments

  • The following covers the four different combinations of gold and stock:
    (if: $gold_coins > 5 and $number_health_potion > 0)[Enough gold and some stock]
    (else-if: $gold_coins > 5 and $number_health_potion is 0)[Enough gold but no stock]
    (else-if: $gold_coins <= 5 and $number_health_potion > 0)[Not enough gold to buy the existing stock]
    (else:)[Not enough gold and no stock]
    
  • I see, I thought it has something to do with else-if, thanks a lot!
Sign In or Register to comment.