Watching values
game.Frame, and signals that fire when a value of the game changes.
The Explorer searches everything on this page, and the classes of the game too.
game.Frame
The frame signal, game.Frame. Wax fires it once every frame. A mod connects handlers to it and disconnects its own. It has no Fire and no DisconnectAll.
Type name: WaxFrameSignal.
game.Frame:Connect(fn)
Calls fn(seconds) once every frame. seconds is the time since the frame before, and 0 on the first frame Wax runs. Each call runs as a task and may pause. A handler that is still paused is called again on the next frame all the same. The handler is disconnected when the mod unloads.
game.Frame:Connect(fn: fun(seconds: number)): WaxConnection| Parameter | Type |
|---|---|
fn | fun(seconds: number) |
Returns WaxConnection
game.Frame:Once(fn)
Like Connect, for the next frame only.
game.Frame:Once(fn: fun(seconds: number)): WaxConnection| Parameter | Type |
|---|---|
fn | fun(seconds: number) |
Returns WaxConnection
game.Frame:Wait()
Pauses the calling task until the next frame and returns the seconds since the frame before. It only works inside a task.
game.Frame:Wait(): numberReturns number (seconds)