Sign in to follow this  
Followers 0
nf67

Substracting from a variable

3 posts in this topic

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 command

Any 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.

Share this post


Link to post
Share on other sites



Thank you, Zedna :P

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0