Jump to content
Sign in to follow this  

Substracting from a variable

Recommended Posts


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



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

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.