Best Practice: Variables
If you're on this site at all, I'm sure you know what a variable is. They store data!
Different languages have different ways of declaring them. Here are a few examples
However, GameMaker Language is a little different. There are 3 ways of declaring variables.
Global Variables
Of course, you can declare a global variable using the global keyword.
This will make the variable available to every object after it has been declared.
Note
It's best to declare global variables at the start of your game.
Such as in the Create event of an object that it spawned first thing.
This avoids potential issues if you try to call a global variable before it has been assigned.