Lotsa problem...
- You didn't initiate the random value. Just the condition.
- You repeat the same command. That's just inneficient.
- You use wait. it will cause delay because it has to finish the "wait" command first before checking the "press ok" condition.
Here's the fix :
- It uses a variable as an alternative of wait. So delay 10 * wait 1 frame wil be equal to 10 frame wait.
- You don't need to set the sprite image again after stopped because the loop already break.
- I put the random variable directly inside the script call so it doesn't need to be checked again.
Unless it wasn't supposed to be random and the visual have to change 1, 2, 3 in sequence...