Timer event doesn't restart once restarting event

my timer isnt working if i trigger one of my stop timer event
i have other events that stops the timer too but are under a conditional branch
I have 3 events that stops the timer and enables me to restart the event
finish 3 laps and if the timer reaches 0 will trigger the stop timer as well as resetting the events
once i start the event again, the timer ticks down like normal, however i have a player touch event that suppose to stop the time and also reset all the events too, however once i restart the event the timer does not show

This triggers the start event
1689847526564.png

this triggers the timer event
1689847565251.png
1689847638052.png


this starts the timer and also ends the event after conditions are met
1689847674864.png
1689847718777.png


and this event suppose to trigger a 3rd option but if i trigger this event and restart the event, the timer does not start anymore
1689847739954.png
You have some strange logic going on here.

For one thing, there are some flaws in how you've constructed your events. As a general rule, you never want to have a parallel event running without Wait commands to slow it down - that means it's going to process every frame, 60 times a second.

For another, we're lacking some information to troubleshoot this.

A number of events transfer the player to coordinates on Map 22. Is that a different map? Or just a different part of this map? What map are each of these events on?

That's really important because parallel/autorun map events won't do anything when you're on a different map.
It’s the same map, I just haven’t named the map yet, it transfers u to another part of the map
Isn't the problem here that your flame event isn't turning off the self-switch A in your 'timer' event? So the timer event never returns to its first page where you start the timer, if you stop the race through the flame event?
It’s the same map
In that case:

Event 15: What's the point of this? You have an event that doesn't do anything except flip a switch on, you can do that from Event 14. Then I don't understand your intent with the second page - it's a parallel event (which should always have a Wait command), and the only thing it does is if you turn the "Start time event" switch off, it will immediately turn it back on. Why?

Event 11: Again, this parallel event should have a wait on it. I don't see where you set values to your Lap variable, but it can't possibly be frame-dependent.

It also doesn't look like the second branch is right. You're saying if you run out of time, transfer the player back and immediately restart the ten second timer? That seems difficult/frustrating to work with.

Event 8: Ultimately, your problem is you've split this over so many events and pages that you've confused yourself. If you cut through all of the stuff, the only way the timer will start is if Start time event is switched ON and Event 11 does not have Self Switch A.

As @rpgLord69 pointed out, Event 8 does not do that.

I would personally suggest re-thinking some of the logic in here and restructuring these events, but to address your actual question, the only thing you need to do is add a script call to turn off that switch.
Code:
$gameSelfSwitches.setValue([22, 11, 'A'], false)
where would i place the script, and how would you reconstruct the events?
Ok, i cleaned up the events and added the script call but now after touching the trap and then activating the trial again, the timer still doesn't show and the player can move straight away. at the beginning of the trial, i made the player wait a few seconds with a countdown, then the player can move

Event to activate a time trial, you talk to the guy to activate the Entry event, it then teleports you to the arena

1689907453041.png

The event that starts the race. Once time runs out or you finish 3 laps you are teleported out of the arena, next to the entry event that starts the trial again which needs to be activated if clicked on it, so the conditional branches do not teleport me at the start of the arena but teleport me out of the arena, so u have to manually activate the trial again if you want to run the course again
1689907698964.png
1689907729139.png
1689907748168.png

This is the touch event which is the 3rd way to stop the trial and teleport you out of the arena the Flame on switch just has another event that animates the flame turning on and off so irrelevant to my problem
1689907928108.png

The Lap variable, when crossing the finish line it adds a +1 variable and when u cross 3 times the trial ends and you teleport out of the arena which is noted in the conditional branch, the variable is set to 0 after the trial ends
1689908050107.png

This is just an indicator giving u a 3, 2,1 countdown before u start the race. you cannot move while it is counting down
1689908190368.png
1689908279005.png


I hope this explains it more clearer on what i was trying to achieve
omg i think i did it, had to use 2 scripts, this event was bugging me so much, thnx for the script
1689909216966.png

Original thread: https://forums.rpgmakerweb.com/threads/timer-event-doesnt-restart-once-restarting-event.159518/