I’m trying to make a script for a pokemon’s exp. When it has enough, it will display the alert telling the user that it has leveled up, but when it doesn’t have enough, it just displayers the current exp/limit. The problem is that even if exp is less than the limit, it goes through the level up process instead of displaying the exp/limit. I’ve looked through this many times and still can’t figure out what’s wrong.
Here’s the script:
--levels
set pika to "rarr"
set limit to 20 as text
set level to 1 as text
set exp to 0
set expamount to (random number from 3 to 7)
display alert pika & " got " & expamount & " exp!"
exp + expamount
set exp to result as text
--display alert exp
--display alert limit
if exp is less than limit then
display alert exp & "/" & limit
else
display alert pika & " leveled up!"
level + 1
set level to result as text
exp - limit
set exp to result as text
display alert pika & " is now level " & level
limit + 10
set limit to result as text
end if