M MY Multiplayer: Wiki
Side
Kind

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

NameTypeDescription
timertimerThe timer, the number setTimer returned.
pausedbooltrue 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)

See also