setTimerPaused
Shared
Pauses or resumes a timer. While paused it keeps the time it had left and is not called.
bool setTimerPaused(timer timer, bool paused)
Parameters
| Name | Type | Description |
|---|---|---|
| timer | timer | The timer, the number setTimer returned. |
| paused | bool | true to pause, false to resume. |
Returns
true if it changed, false if the timer does not exist in this resource.
Example
local round = setTimer(function()
outputDebugString("round over")
end, 120000, 1)
local paused = false
addCommandHandler("pause", function()
paused = not paused
setTimerPaused(round, paused)
end)