GM8 script that worked before, but doesn't work ANYMORE!

Hi! I am using Game Maker 8

I am using the following information for my "Player.Object":

CREATE:
CODE:
grav=.3;
mspeed = 8;

STEP:
CODE:
if (place_free(x,y+1)) {
gravity = grav;
}else{
gravity = 0
}

COLLISION -><- WITH "GROUND":
CODE:
vspeed = 0;

SPACE BUTTON:
CODE:
if!(place_free(x,y+1)) {
vspeed -= 8;}

This scripts are used to make a character JUMP, and I have used them sooo many times before, but suddenly it doesn't work at all!

It is a bug because it just randomly popped up, and when the scripts worked one second earlier too!

Look at this VIDEO if you want a clearer explanation (please look in FULLSCREEN):



PLEASE HELP ME! I am mad at Game maker because I have experienced so many random and unlogical bugs!

/Thank You
Like the error message says, GM doesn't recognize the variable grav

Variables in GM8 are local to objects. If you are going to write a variable in code you need to tell it where that variable is.
instead of:
grav=.3
it needs to say:
mario.grav=.3

But since gravity is a built-in variable I'm assuming you want to make a global variable for grav.
To do that you need to call it:
global.grav=.3
This way you can have all your objects gravity equal to one variable.
Thank you, once again Coyotecraft!:) Will be trying this

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=73479