GlobalState, which the server publishes and the game replicates. There is no round trip and no request — the value is already on the machine — so client reads are synchronous and safe inside a tick.
Only
shared flags are published. Reading a server flag from a client is
exactly like reading one that does not exist: it returns the fallback.Exports
IsFlagEnabled
IsFlagEnabled
Checks whether a boolean flag is on.Parameters
- key:
string— The flag’s key - fallback:
boolean— Returned when the flag is not a readable boolean flag (optional,falseby default)
- enabled:
boolean— Whether the flag is on
GetFlagValue
GetFlagValue
Reads a flag’s value, whatever its type.Parameters
- key:
string— The flag’s key - fallback:
any— Returned when the flag is missing, or before the server has published any (optional)
- value:
any— The flag’s value, or the fallback
GetFlags
GetFlags
Reads every flag this client holds, keyed by flag key.Returns
- values:
table— The flag values, keyed by flag key. Empty before the server has published any.
AreFlagsReady
AreFlagsReady
Whether the server has published any values yet.Returns
- ready:
boolean
Reading the state bag directly
The exports are a thin wrapper that handles the empty case. Nothing stops you reading the bag yourself:flags.global_state_key from your configuration — nocloud_flags by default.
Reacting to changes
There is no client event. Watch the state bag directly:What leaves the client
Almost nothing. Reading tells the server that this client reads flags, so it keeps them current, and five minutes without a read tells it you have stopped.Those two signals carry no data and only fire at the edges — not per read.
Every read is a local lookup and nothing more, so reading a flag inside a tick
sends nothing over the network.
Lua Library
For a cleaner API, include the client Lua library in yourfxmanifest.lua:
Cloud.flags autocompletes with parameter and return types in any editor with the Lua Language Server.
