Okay, well you would first need to initialise the global variable. Commonly, this is done in a script which is called from the the FIRST object placed in the game (like a main menu or a splash screen or whatever). It would look like this:
Code:
global.hp = 100;
global.scr = 0;
global.whatever = "whatever";
// etc...
Now, in your game, you would have an object like "obj_GameControl" in your room, and in the DRAW GUI event you'd simply put something like:
Code:
draw_text(32, 32, "Life = " + string(global.hp));
draw_text(32, 48, "Score = " + string(global.scr));
// etc...
We use the draw GUI event, as it makes drawing stuff like this a lot easier as it isn't affected by the camera position.
Finally, in -for example - the player collision with an enemy you'd do something like:
Code:
global.hp -= 10;
if global.hp <= 0 instance_destroy();
To remove health from the global variable as well as check to see if the health value is less than zero.
I hope that helps!