Forget my previous thread! THIS is the real thing! Tested and working! It displays a "Game Over" message when you lose your last life... WITHOUT LAG!
Actually, the solution was so simple I feel stupid for not realizing it before

I just needed the "Active Time" parameter of the code that checks the number of hearts to be 1 instead of 0. This is the code:
Code: Select all
#0 //Section number where it applies. 0 means always
OnGlobalMem,0x00B2C5AC,0,0,1001,0,f //Checks if the player's number of lives equals 0 and calls event 1001
#1001
OnPlayerMem,0x16,0,0,1002,1,w //Checks if the player's number of hearts equals 0 as well (not tested with Mario or Luigi) and calls event 1002. The fifth parameter MUST be 1!
#1002
ShowText,0,300,260,3,0,GAME OVER //Shows the text
Again, I only know it works with characters with a heart system (Toad, Peach and Link), but only really tested it with Toad. For Mario and Luigi, you might want to check whether the player is just plain dead instead of the number of hearts, but I could only make this work with the hearts. Also, you still need to put this code in EVERY level, since I haven't gotten a lunaglobal.txt file to work.