in your global script, add 'int health;' at the top, and 'export health;' at the bottom. In your global header, add 'import int health;'.
Then in repeatedly_execute, add something like
Code: ags
Then in repeatedly_execute, add something like
if (AreCharactersColliding (EGO, enemy)) health --;
if (health <= 0) GUIOn (GameOverGUI);