config/jobs.lua, a data config. Every character has exactly one job. New characters start as unemployed, which MUST exist.
config/jobs.lua
grades. Read every definition with UgCore.Config.Get('jobs'), on the server or the client.
Server
Get
Set / SetGrade
grade defaults to 1. The job is saved with the character.
A new grade in the same job keeps duty. A different job starts at its
defaultDuty.SetDuty / IsOnDuty
defaultDuty when the character loads and is never saved.
Exists / GetDefinition
Client
ug-core:Job statebag of the local player.
Errors
SetDuty raises when onDuty is not a boolean.
Events
Hooks
Runs for
Set and SetGrade. It allows or cancels. Changes to the payload are ignored.
Statebags
Index them withUgCore.Enums.StateBags. See Statebags.
client.lua