Skip to content

killTimer

Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function allows you to kill/halt existing timers.

OOP Syntax Help! I don't understand this!

  • Method:timer:destroy(...)

Syntax

bool killTimer ( ​timer theTimer )
Required arguments
  • theTimer: The timer you wish to halt.

Returns

Returns true if the timer was successfully killed, false if no such timer existed.

  • bool: value

Code Examples

shared

This example kills all timers with a remaining time of less than 1 minute.

-- Find and kill all the timers with less than 1 minute to go
timers = getTimers ( 60000 )
-- Loop through the timer list
for timerKey, timerValue in ipairs(timers) do
-- kill the timer
killTimer ( timerValue )
end