Use a global variable: myVariable = 0 ; when attack button pressed or monster attacks set myVariable to 1
Under the condition that myVariable = 1 - Start Game [Run the events that start your game]
-
To stop the fight & run away without a new monster spawning: Use a global variable; On start of layout myVariable = 0
Add myVariable = 0 to the condition you already set for the monsters to spawn.
If monsters (INVERT)-Is on screen - set myVariable to 1
If monsters Is on screen - set myVariable to 0
To assure that monsters spawn when/where you want them to & there aren't any already on screen: clone your monster & set spawning events accordingly, i.e if myVariable= 0 & when you reach a certain point in the layout - you can use an invisible sprite to represent that "certain point" spawn monsters.
or on collision with "certain point" set myVariable to 0 and spawn monsters accordingly based on is/isn't on screen.