Search the docs

Find a guide, global, type or member

GlobalLibraries

data

The experience's persistent key-value store.

Functions

data.get(key: string) -> Value#

The stored value, or nil if there is none.

data.set(key: string, value: Value?)#

Stores a value. Raises on any other type, a bad key, an oversized string or a full store. nil removes

data.remove(key: string) -> boolean#

Removes the key; true if it held a value.

data.has(key: string) -> boolean#

Whether the key holds a value.

data.keys(prefix: string?, limit: number?) -> { string }#

Keys that start with prefix (default: every key), in sorted order. Player keys are included under their player:<uuid>: prefix. sorted; limit defaults to 1000, at most 10000

data.bytes() -> number#

Bytes the store uses now, counted as described above.

data.limit() -> number#

The most bytes the store may hold.

data.player(player: PlayerRef) -> PlayerData#

The given player's data. The same player always gets the same handle. keys "player:<uuid>:<key>"