Page 1 of 1

Script Problem Solved

Posted: 28 Aug 2016, 1:10
by Alvespires
Guys I'm real sorry if this is a awful question but...On my Shop,I need to make a Mushroom appear if player has more than one Coin,but if he has less,show a message...But even if you have more coins,the message show. :(

Here's the Scripts I'm using:

Spoiler
If gval(Coins) >= 1 Then
Call NCreate(9,char(1).X,char(1).Y,0,0,0,0)
gval(Coins)=gval(Coins)-1

If gval(Coins) <= 1 Then
Call ShowMSG("But you don't have enough...")
End if

What I'm doing wrong?

Posted: 28 Aug 2016, 1:14
by Yoshi021

Code: Select all

If gval(Coins) <= 1 Then
Call ShowMSG("But you don't have enough...")
End if

What you are saying here is:
If the player has 1 coin or less then show ("But you don't have enough...").
Try changing it into

Code: Select all

If gval(Coins) < 1 Then
Call ShowMSG("But you don't have enough...")
End if

Posted: 28 Aug 2016, 1:27
by Alvespires
Oh OK thanks so much :D you're helping a lot on my levels :D

Posted: 28 Aug 2016, 1:30
by Yoshi021
Your welcome ;-)