Skip to main content
Server Client Proxied to ug-core. Jobs are defined in config/jobs.lua, a data config. Every character has exactly one job. New characters start as unemployed, which MUST exist.
config/jobs.lua
Grades are 1-based indexes into grades. Read every definition with UgCore.Config.Get('jobs'), on the server or the client.

Server

Get

table
nil without a loaded character.

Set / SetGrade

MUST run in a thread. 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

Duty is session state. It starts at the job’s defaultDuty when the character loads and is never saved.

Exists / GetDefinition

Client

Read from the 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 with UgCore.Enums.StateBags. See Statebags.
client.lua

Example