Trying to make a minigame.

Trying to make a treadmill minigame, where a time is set for 10 seconds, and for every time the player pushes a button down during those 10 seconds, they get a point. When the timer is up, the points are tallied, and the event ends. But for some reason, the timer won't stay. It just goes to the conditional branch to when the timer is supposed to be 10 seconds or more. I checked that I set the condition right, but it doesn't seem to be working either way. Any help on this?
Code? Sample map? Do you turn off your event with timer?
Yeah code must be wrong.
I think it could be due to you using a conditional branch (like an else statement) during the timer that is not necessary. You could try wrapping it in a loop

Control timer start 10 seconds

Loop // start of loop

if "Z is pressed" //here you put whatever you are using to check the player's input
score = score +=1 //add 1 to score variable every time z is pressed

if timer = 0
Control self switch : A // exits the loop if time is up


Wait 1 Frame
Repeat above // end of loop


then under self switch A you put something like

text: your score is [score]

It should work, I have something similar in my game

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-make-a-minigame.122839/