KillTimer: Difference between revisions
Jump to navigation
Jump to search
Automatyczna aktualizacja dokumentacji funkcji |
Complete Lua function catalog |
||
| Line 31: | Line 31: | ||
* Available in both client-side and server-side resource scripts. | * Available in both client-side and server-side resource scripts. | ||
[[Category:Lua Functions]] | |||
[[Category:Shared Functions]] | [[Category:Shared Functions]] | ||
[[Category:Timer Functions]] | [[Category:Timer Functions]] | ||
[[Category:Utility Functions]] | [[Category:Utility Functions]] | ||
Latest revision as of 09:54, 15 August 2026
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.