Skip to main content

Using StateBags

Available from this version: 1.9.2

Available StateBags

ArgumentTypeExplanation
identifierstring
licensestring
jobtable
groupstring
namestring
metadatatable

Example Client-Side Usage

local playerState = LocalPlayer.state

RegisterCommand('stateBags', function(source, args, rawCommand)
print('Identifier: '..playerState.identifier)
print('License: '..playerState.license)
print('Job: '..json.encode(playerState.job, {indent = true}))
print('Group: '..playerState.group)
print('Name: '..playerState.name)
print('Metadata: '..json.encode(playerState.metadata))
end)

Example Server-Side Usage

RegisterCommand('stateBagsServer', function(source, args, rawCommand)
local playerState = Player(source).state

print('Identifier: '..playerState.identifier)
print('License: '..playerState.license)
print('Job: '..json.encode(playerState.job, {indent = true}))
print('Group: '..playerState.group)
print('Name: '..playerState.name)
print('Metadata: '..json.encode(playerState.metadata))
end)