KillTimer
Jump to navigation
Jump to search
killTimer
Cancels an active timer.
Syntax
bool killTimer(int timerId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
timerId |
int |
yes | The identifier returned by setTimer.
|
Returns
Returns true if an active timer was cancelled; otherwise returns false.
Examples
Create and cancel a repeating timer:
local timer = setTimer(function()
print("tick")
end, 1000, 0)
killTimer(timer)
Notes
- Available in both client-side and server-side resource scripts.