Appearance
K.Machine
Functions
K.Machine.Define
lua
K.Machine.Define(name: any, options: any): MachineK.Machine(name?, options): a named machine reaches clients; without a name it's private. On clients, K.Machine(name) returns the named machine to read.
K.Machine.Get
lua
K.Machine.Get(name: string): MachineMethods on machine
machine:State
lua
machine:State(): stringmachine:Is
lua
machine:Is(name: string): booleanmachine:TimeLeft
lua
machine:TimeLeft(): numberSeconds until the state's Duration runs out (0 without one).
machine:TimeIn
lua
machine:TimeIn(): numberSeconds since the machine entered its current state.
machine:Go
lua
machine:Go(name: string)Moves to a state now (running Exit and Enter).
machine:OnChanged
lua
machine:OnChanged(callback: (string, string?) -> ())callback(new, old) after every move.
machine:OnEnter
lua
machine:OnEnter(state: string, callback: (any, string?) -> ())callback(machine, oldState) whenever the machine enters state, from any script.
machine:OnExit
lua
machine:OnExit(state: string, callback: (any, string) -> ())callback(machine, newState) whenever the machine leaves state.
machine:Stop
lua
machine:Stop()Stops the machine for good (the current state's Exit doesn't run).
Generated from
src/Corode/Machine.luau.
