Timer

Summary

Timers can be used to call functions at a predetermined time (or multiple times)

Class Methods

Timer:Set(fn, interval, delay, repeats)

Sets up a function to be called in the future

Returns: nil

Parameters:

NameTypeDefaultDescription

fn

function

The function to call

interval

number

How long to wait inbetween repeated calls

delay

number

0

How long to wait until the first call

repeats

number

-1

The number of times to call the function. A value of -1 means "run forever"

Example

Timer:Set(myFunction, 1, 0, 5)

Timer:Unset(fn)

Removes a future function timer

Returns: nil

Parameters:

NameTypeDefaultDescription

fn

function

The function to remove

Example

Timer:Unset(myFunction)

Last updated