IsTimer
Jump to navigation
Jump to search
isTimer
Checks whether a timer identifier still refers to an active timer.
Syntax
bool isTimer(int timerId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
timerId |
int |
yes | The timer identifier to inspect. |
Returns
Returns true for an active timer; otherwise returns false.
Examples
Check a timer before cancelling it:
local timer = setTimer(function() end, 5000, 1)
if isTimer(timer) then
killTimer(timer)
end
Notes
- Available in both client-side and server-side resource scripts.