M MY Multiplayer: Wiki
Side
Kind

isTimer

Shared

Tells whether a timer still exists in this resource.

bool isTimer(timer timer)

Parameters

NameTypeDescription
timertimerThe timer, the number setTimer returned.

Returns

true if the timer exists, false if it ended, was cancelled or never existed.

Example

local countdown = setTimer(function()
    outputDebugString("go")
end, 5000, 1)

addCommandHandler("abort", function()
    if isTimer(countdown) then
        killTimer(countdown)
    end
end)

See also