Checking if a timer.Create is paused.


I’m wondering if there’s a way to check if a timer is paused, I’ve tried something like:

if timer.Pause( "Test" ) == true then

elseif timer.Pause( "Test" ) == false then


But this doesn’t seem to work, I heard there’s something called timer.Check(), but don’t think that’s correct.

timer.Pause returns “false if the timer didn’t exist or was already paused, true otherwise.”

So if you want to check if it’s paused, it’s going to be paused if it exists.
local e = timer.Exists(“TestTimer”)
local p = timer.Pause(“TestTimer”)

– Since it returns false if it doesn’t exist OR was already paused
– we need to differentiate what it was returning false for

if § then
– timer was just paused
– just unpause it here if you don’t want it paused
elseif (e) then
– timer was already paused
– timer doesn’t exist

[editline]21st October 2017[/editline]

You could store a boolean in a table every time you create a timer, then just change that when you pause/unpause it as well. (and use that to check if it is paused)