How to use State Bags
A State Bag is a sticky note attached to a player or entity that every resource can read. You write a value once, and FiveM copies it everywhere automatically. No events, no asking around. Need to know a player's job, hunger, or radio channel? Just read their note. In 2026 this is the standard way to share data that lots of resources need but nothing breaks if it's a beat late.
Build it
Create the resource
resources/qu_statebag_demo/
fxmanifest.lua
server.lua
client.lua
fx_version 'cerulean'
game 'gta5'
server_script 'server.lua'
client_script 'client.lua'
Set a State Bag value (server)
Write a value to a player's note. We do this on the server because the server is the boss of player state:
-- Set a State Bag value for a player
local playerId = 1 -- replace with actual player ID
local playerState = Player(playerId).state
playerState:set('job', 'police', true) -- true = replicate to all clients
print(('Set player %s job to police'):format(playerId))