Create an actor variable for the pause (ispaused), and a timer for the pausebutton:
Then button>mousebuttondown>
- Code: Select all
- switch(ispaused){
 case 0:
 ispaused=1;
 animpos=1;
 CreateTimer("Event Actor", "1", 50);
 break;
 
 case 1:
 PauseGameOff();
 ispaused=0;
 animpos=0;
 break;
 }
Then on the timer>
- Code: Select all
- PauseGameOn();
The timer allows you to run other events before the pause happens, such as a strcpy to a text actor "press p to unpause" in case they have any problems clicking on it again (like if you're using a custom cursor or whatnot).
Note: this works in GE 1.39. Not sure about other versions.