isTimer
Shared
Tells whether a timer still exists in this resource.
bool isTimer(timer timer)
Parameters
| Name | Type | Description |
|---|---|---|
| timer | timer | The 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)