nf67 Posted October 4, 2008 Posted October 4, 2008 Hi there,Is there an easy way to substract from a variable?I am creating a little game in which you have 3 lives, I need to substract 1 every time a certain thing happens that should make you lose one.I tried the following:$Lives = 3 (...) if (certain thing happens) then $Lives-1 (...) If $Lives = 0 Then MsgBox ( 0, "Game Over", "Game Over" )Now my problem is that "$Lives-1" doesn't seem to be a valid commandAny help is much appreaciated. P.S: I cna also post my full code, but I'd rather keep the forum clean and thought this would do.
Zedna Posted October 4, 2008 Posted October 4, 2008 $Lives=$Lives-1 or $Lives-=1 Resources UDF ResourcesEx UDF AutoIt Forum Search
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now