killTimer | Multi Theft Auto: Wiki Skip to content

killTimer

Client-side
Server-side
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

  • bool: value

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

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