Skip to content

K.Timer ​

Functions ​

K.Timer.Define ​

lua
K.Timer.Define(name: string, options: { Duration: number?, Shared: boolean?, Saved: boolean? }?): Timer

K.Timer(name, options?) is the same as K.Timer.Define(name, options?).

K.Timer.Get ​

lua
K.Timer.Get(name: string): Timer

K.Timer.Exists ​

lua
K.Timer.Exists(name: string): boolean

Methods on timer ​

timer:TimeLeft ​

lua
timer:TimeLeft(player: Player?): number

Seconds left (0 when it isn't running). Clients: your own, or TimeLeft(otherPlayer).

timer:IsRunning ​

lua
timer:IsRunning(player: Player?): boolean

timer:IsReady ​

lua
timer:IsReady(player: Player?): boolean

True when the timer isn't running, e.g. a cooldown that has passed.

timer:Start ​

lua
timer:Start(...: any)

Server: starts (or restarts) the timer for seconds, or its Duration.

timer:Add ​

lua
timer:Add(...: any)

Server: adds time; starts the timer if it isn't running.

timer:Stop ​

lua
timer:Stop(player: Player?)

Server: ends the timer now, without OnFinished.

timer:OnFinished ​

lua
timer:OnFinished(callback: (Player?) -> ())

Server: callback(player) when a timer runs out (callback() for shared timers).

Generated from src/Corode/Timer.luau.

Corode 0.13.0 · MIT License