Skip to main content
Data that is read often replicates through statebags. Reading a statebag costs nothing: no export, no network round trip.
Prefer statebags over API calls for read-heavy data such as job, duty, loaded state and death state. Exports copy tables on every call.

Player statebags

Set by the server only, on Player(source).state. Index them with UgCore.Enums.StateBags, never with the string:
Player statebags reach every client. Never put secrets in replicated metadata.

Read them

React to changes

client.lua

Global state

Indexed with UgCore.Enums.GlobalState.