Skip to content

state.create

function

Creates or gets the global State with the key. A key that exists with another default, scope or schema is an error.

state.create<T>(key: string, default: T?, schema: Schema<T>) -> State<T>
example
local score = state.create("score", 0, schema.number())

Use it forkeeping one value that every script shares for the whole game, like the round phase.

keyThe State key. Every script that creates it shares it.
defaultoptionalThe value before anything sets it.
schemaWhat values it accepts.

Tip of the day

From: USBX

HOME Menu

Wii Menu

Wii Remote Settings