Pause and resume all timers with button?

Hi, I’m wandering how to make a pause and resume button that pauses all my timers and physics. It is basically my final step before my game is complete and im having slight problems with how to go about making it. I managed to cancel my timers when the game is over with the code below but wandering how to pause and resume them all.

timerStash = {} local function cancelAllTimers() local k, v for k,v in pairs(timerStash) do timer.cancel( v ) v = nil; k = nil end timerStash = nil timerStash = {} end timerStash.timer1 = timer.performWithDelay( 10000, spawnCharacter, 0 ) timerStash.timer2 = timer.performWithDelay( 12000, spawnCharacter1, 0 ) timerStash.timer3 = timer.performWithDelay( 18000, spawnCharacter2, 0 ) timerStash.timer4 = timer.performWithDelay( 7000, spawnBomb, 0 )

Please see the documentation.  There exists a timer.pause and timer.resume

For physics there is physics.pause() and physics.start() (it works both as start and resume). For timers check documentation.

Please see the documentation.  There exists a timer.pause and timer.resume

For physics there is physics.pause() and physics.start() (it works both as start and resume). For timers check documentation.