How to Add Jobs to a FiveM Server (Qbox, QBCore, ESX)
How to add jobs to a FiveM server on Qbox, QBCore and ESX Legacy, with jobs.lua and gangs.lua blocks, the ESX job tables, /setjob and the common errors.

- Applies to
- FiveM Legacy and FiveM for GTAV Enhanced; qbx_core v1.24.1 (October 30, 2026), ESX Legacy 1.16.4 (October 18, 2026), qb-core repository as of August 24, 2026 (legacy reference)
- Last verified
On this page
- Direct Answer
- Where jobs are defined on Qbox, QBCore and ESX
- Qbox jobs: add a job to qbx_core/shared/jobs.lua
- QBCore jobs.lua: add a job (legacy reference)
- ESX jobs: add a job to the jobs and job_grades tables
- Paychecks and duty
- How to give a player a job: /setjob on Qbox, QBCore and ESX
- How to add gangs on Qbox and QBCore
- FiveM Legacy and FiveM for GTAV Enhanced
- Troubleshooting
- Next Steps
Direct Answer
To add jobs to a FiveM server, add the job to your framework’s job list, load it, then give it to a player with /setjob. On Qbox, add a block to qbx_core/shared/jobs.lua with a lower-case name, a label and numbered grades written without quotes ([0]), then restart the server. On QBCore, the file is qb-core/shared/jobs.lua and grade keys are strings (['0']). On ESX Legacy, insert one row in the jobs table and one row per grade in job_grades, then run refreshjobs. Gangs sit next to jobs, in shared/gangs.lua, on Qbox and QBCore.
Where jobs are defined on Qbox, QBCore and ESX
A job is a record the framework keeps: a name, a display label, grades (ranks) and the pay of each grade. Scripts such as a police or mechanic job read that record to decide who may use their features. Adding a job to the list does not add any gameplay by itself: duty points, vehicles and menus come from a job script. A server without a framework has no job list at all. The txAdmin recipe “FiveM Basic Server” is described as “A minimal server, without framework”, so racing, PvP or freeroam servers built on it only get jobs if they install a framework or a standalone job script that brings its own system.
| Qbox | QBCore (legacy reference) | ESX Legacy | |
|---|---|---|---|
| Jobs | qbx_core/shared/jobs.lua | qb-core/shared/jobs.lua | jobs and job_grades tables |
| Gangs | qbx_core/shared/gangs.lua | qb-core/shared/gangs.lua | No gang list in the core |
| Grade keys | [0], [1] (numbers) | ['0'], ['1'] (strings) | grade column (number) |
| Pay field | payment | payment | salary |
| Load a change | Restart the server | Restart the server | refreshjobs or restart |
| Give a job | /setjob id job [grade] | /setjob id job grade | /setjob id job grade |
QBCore is shown as a reference only. Its documentation now says “QBCore has withdrawn from other platforms” and that its pages “remain here as a reference”. The QBCore, Qbox and ESX comparison explains what that means for a server today.
Qbox jobs: add a job to qbx_core/shared/jobs.lua
The Qbox job fields
The Qbox documentation defines a job with these fields, and the grades table uses integer keys (grades: table<integer, JobGradeData>):
| Field | Type | What it does |
|---|---|---|
label | string | Name players see |
type | string, optional | Group of jobs; the default file uses leo for police and ems for the ambulance job |
defaultDuty | boolean | Whether the player starts on duty |
offDutyPay | boolean | Whether the player is paid while off duty |
grades[n].name | string | Rank name |
grades[n].payment | number | Pay per paycheck |
grades[n].isboss | boolean, optional | Marks a boss rank |
grades[n].bankAuth | boolean, optional | Lets that rank use the job’s bank account |
Steps
- Open the file. Stop the server and open
resources/[qbx]/qbx_core/shared/jobs.lua(the folder layout of the Qbox recipe). The file starts with the comment “Job names must be lower case (top level table key)” and thenreturn {. - Copy an existing block. The
mechanicjob of the default file is a complete five-grade example. It is shown here insidereturn { }as in the file: copy only the['mechanic'] = { ... },part, paste it before the last closing brace, and change the key, the label and the grades:
return {
['mechanic'] = {
label = 'Mechanic',
type = 'mechanic',
defaultDuty = true,
offDutyPay = false,
grades = {
[0] = {
name = 'Recruit',
payment = 50
},
[1] = {
name = 'Novice',
payment = 75
},
[2] = {
name = 'Experienced',
payment = 100
},
[3] = {
name = 'Advanced',
payment = 125
},
[4] = {
name = 'Manager',
isboss = true,
bankAuth = true,
payment = 150
},
},
},
}
- Keep the name in lower case. On start, qbx_core prints
jobs.lua contains a job name with capital letters: <name>for any key that is not lower case. - Number grades from 0, without quotes. The Qbox migration guide states: “Grade numbers are written without quotes. [‘0’] becomes [0]. With quotes, Qbox can’t find the grade.” Commands that take no grade use grade 0. The
player_groupstable stores the grade asTINYINT(3) UNSIGNED, which in MariaDB holds 0 to 255. - Give the boss rank
bankAuth = true. Per the Qbox docs, “Boss grades need bankAuth = true to use the job’s bank account”, because Renewed-Banking “checks this instead of isboss”. - Keep
unemployed. It is the job of every character without one. If it is missing, characters cannot load and qbx_core stops with “Unemployed job not found. Does it exist in shared/jobs.lua?” - Restart the server. qbx_core loads the file when it starts (
local jobs = require 'shared.jobs'inserver/groups.lua), so a full restart is the simple way to load an edit.
A new police job needs one more line outside qbx_core. The Qbox docs say: “if you have police jobs besides police, bcso and sasp, add their names to inventory:police in ox.cfg”, so the job can use the police features of ox_inventory.
A missing comma or brace shows up as a Lua error naming the file and line. The Qbox docs use this example: SCRIPT ERROR: @qbx_core/shared/jobs.lua:57: '}' expected (to close '{' at line 3) near 'police', and advise to “go to that line and look just above it”.
Before you update qbx_core, copy your edited files out of the resource. The Qbox update steps list “the config folder, and shared/jobs.lua, gangs.lua, vehicles.lua and main.lua”, because the resource folder is deleted and unpacked again.
Add a job from a script with CreateJob
Scripts can add jobs at runtime with exports.qbx_core:CreateJob(jobName, job) or CreateJobs. The Qbox export documentation says: “This is a runtime-only change. This won’t persist across restarts and won’t modify files.” The v1.24.1 source disagrees in one point: it adds an optional third argument, commitToFile, which rewrites the whole shared/jobs.lua from the jobs loaded in memory with SaveResourceFile. The rewritten file writes label, defaultDuty, offDutyPay and the grades of every job, but no type line for any of them, so keep a copy of your file before you pass true.
Multiple jobs per character: qbx:max_jobs_per_player
qbx_core has a built-in multijob. The Qbox docs say the qbx: settings in server.cfg include “qbx:max_jobs_per_player for multiple jobs per character”. Each job a character holds is a row in player_groups, the table that “the boss menu and multiple jobs use”.
| Convar (server.cfg) | Default | What it does |
|---|---|---|
set qbx:max_jobs_per_player 1 | 1 | Maximum jobs per character |
set qbx:max_gangs_per_player 1 | 1 | Maximum gangs per character |
set qbx:setjob_replaces "true" | true | /setjob replaces the current job instead of adding one |
set qbx:setgang_replaces "true" | true | Same for /setgang |
set qbx:cleanPlayerGroups "true" | see below | Deletes jobs and grades that are no longer in your files from player_groups on start |
To let a character hold three jobs, set set qbx:max_jobs_per_player 3 and restart. Then /addjob 23 mechanic adds a job (grade 0 unless you add a grade after the name), /changejob 23 mechanic switches the active job and /removejob 23 mechanic takes one away. The player ID always comes first.
Read qbx:cleanPlayerGroups before you rename or delete a job. When it is on, qbx_core deletes every player_groups row whose job or grade is no longer in your files, and logs Remove invalid job ... from player_groups table. The Qbox recipe server.cfg sets it to "true". The convar page shows "true" as the default, while the v1.24.1 source falls back to 'false' when the line is absent. Before you rename a job or remove a grade, back up the database or set the line to "false" for that restart.
QBCore jobs.lua: add a job (legacy reference)
On QBCore, jobs are in qb-core/shared/jobs.lua. The QBCore docs list the same job fields as Qbox (label, type, defaultDuty, offDutyPay, grades), with name, payment and the optional isboss per grade. They list no bankAuth field.
- Open
qb-core/shared/jobs.lua. In the current repository the file starts withQBCore.Shared.ForceJobDefaultDutyAtLogin = trueandQBCore.Shared.Jobs = {. Older copies start withQBShared.Jobs = {, as the Qbox migration guide shows. Both hold the same table. - Add a block inside the table, with grade keys in quotes. This is the default
mechanicjob, shown inside the table line it belongs to; copy only themechanic = { ... },part:
QBCore.Shared.Jobs = {
mechanic = {
label = 'LS Customs',
type = 'mechanic',
defaultDuty = true,
offDutyPay = false,
grades = {
['0'] = { name = 'Recruit', payment = 50 },
['1'] = { name = 'Novice', payment = 75 },
['2'] = { name = 'Experienced', payment = 100 },
['3'] = { name = 'Advanced', payment = 125 },
['4'] = { name = 'Manager', isboss = true, payment = 150 },
},
},
}
- Keep the key in lower case.
Player:SetJobrunsjob = job:lower()before it looks the job up, so a key with capitals can never be assigned. - Restart the server.
shared/jobs.luais one of theshared_scriptsin qb-core’sfxmanifest.lua, so it is read when qb-core starts.
qb-core also has a runtime export, exports['qb-core']:AddJob(jobName, job), which refuses an existing name with job_exists and only changes the table of the running server.
ForceJobDefaultDutyAtLogin decides the duty state at login. The comment in the file reads: “true: Force duty state to jobdefaultDuty | false: set duty state from database last saved”.
ESX jobs: add a job to the jobs and job_grades tables
ESX Legacy keeps jobs in the database, not in a Lua file. es_extended.sql creates two tables:
| Table | Columns |
|---|---|
jobs | name VARCHAR(50), label VARCHAR(50) |
job_grades | id, job_name, grade, name, label, salary, skin_male, skin_female |
On start, es_extended also adds a type column to jobs (VARCHAR(50) NOT NULL DEFAULT 'civ') if it is missing. Each character’s current job is stored in users.job and users.job_grade, and users.job is VARCHAR(20), so keep ESX job names to 20 characters or fewer.
- Open the database. Use HeidiSQL or the tool you set up in the MariaDB database guide, and select your ESX database.
- Insert the job and its grades. This follows the
esx_taxijobSQL, with empty outfits ('{}', as theunemployedgrade ines_extended.sqluses) becauseskin_maleandskin_femalecannot be NULL:
INSERT INTO `jobs` (name, label) VALUES
('taxi', 'Taxi')
;
INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
('taxi',0,'recrue','Recrue',12,'{}','{}'),
('taxi',4,'boss','Patron',0,'{}','{}')
;
- Name the top grade
bossif you use esx_society. ItsConfig.BossGradesdefaults to{ ['boss'] = true }, so the boss menu goes by the grade’sname, not by a flag. - Load the job. Run
refreshjobsin the server console, or use/refreshjobsin game asowneroradmin. The ESX docs describe it as: “Refreshes the all known jobs.” A restart works too.
A job with a shared company account also needs rows for that account. The esx_taxijob SQL adds society_taxi to addon_account, datastore and addon_inventory, and the script registers it with esx_society:registerSociety. The script installation guide covers running a resource’s SQL file.
A script can also create a job with ESX.CreateJob, which “creates a new job and inserts it into the database”. The ESX docs example:
ESX.CreateJob("baker", "Baker", {
{grade = 0, name = "apprentice", label = "Apprentice", salary = 320},
{grade = 1, name = "employee", label = "Employee", salary = 470},
{grade = 2, name = "senior", label = "Senior Baker", salary = 610},
{grade = 3, name = "owner", label = "Owner", salary = 910},
})
In the 1.16.4 source, ESX.CreateJob takes a fourth argument, the job type, and uses "civ" when none is given.
Paychecks and duty
| Qbox | QBCore | ESX Legacy | |
|---|---|---|---|
| Interval setting | paycheckTimeout = 10 (minutes, config/server.lua) | PayCheckTimeOut = 10 (minutes, config.lua) | Config.PaycheckInterval = 7 * 60000 (milliseconds) |
| Off duty | Paid only if offDutyPay is true | Paid only if offDutyPay is true | Config.OffDutyPaycheckMultiplier = 0.5 |
| Pay from the company account | paycheckSociety = false | PayCheckSociety = false | Config.EnableSocietyPayouts = false |
How to give a player a job: /setjob on Qbox, QBCore and ESX
Find the player’s server ID first (Qbox has /id), then run the command in game. Each player checks their own job with /job. On ESX, setjob and refreshjobs also run from the server console (for example setjob 23 taxi 4).
| Framework | Command | Who may run it | Notes |
|---|---|---|---|
| Qbox | /setjob 23 mechanic 2 | group.admin | Grade is optional (0). me works as the ID (/setjob me police 4). Admins must type /optin once first |
| QBCore | /setjob 23 mechanic 2 | admin | A grade that does not exist gives the rank “No Grades” |
| ESX Legacy | /setjob 23 taxi 4 | owner, admin | The grade is required |
On Qbox, /setjob replaces the current job while qbx:setjob_replaces is true. The Qbox command page gives /setjob 23 police 3 as “Make player 23 a Police Sergeant (grade 3)”, but in the default jobs.lua grade 3 of police is Lieutenant and Sergeant is grade 2. Read the grade numbers from your own file.
How to get group.admin, /optin and the ESX admin group is covered in the admin permissions guide for Qbox, QBCore and ESX.
How to add gangs on Qbox and QBCore
Gangs work like jobs without pay. They serve gang servers and the criminal side of roleplay servers.
- Open the gangs file:
qbx_core/shared/gangs.luaon Qbox,qb-core/shared/gangs.luaon QBCore. - Copy a gang block. Gangs have a
labeland grades with anameand optionalisboss(plusbankAuthon Qbox). On QBCore the grade keys are quoted, as in its jobs file:['3'] = { name = 'Boss', isboss = true },. On Qbox:
return {
['ballas'] = {
label = 'Ballas',
grades = {
[0] = {
name = 'Recruit'
},
[1] = {
name = 'Enforcer'
},
[2] = {
name = 'Shot Caller'
},
[3] = {
name = 'Boss',
isboss = true,
bankAuth = true
},
},
},
}
- Keep the
nonegang. Characters without a gang use it; qbx_core stops with “none gang not found. Does it exist in shared/gangs.lua?” if it is gone. - Restart, then assign with
/setgang 23 ballas 2. Check with/gang.
On Qbox, qbx:max_gangs_per_player allows more than one gang per character. ESX Legacy’s core has no gang list: its users table holds one job and one job_grade per character, so gangs on ESX come from a separate script.
FiveM Legacy and FiveM for GTAV Enhanced
Jobs, grades and the commands above are part of the framework resources, not of the game client. txAdmin’s recipe list for Enhanced servers (indexv5.json) offers the same ESX Legacy and Qbox recipes as the Legacy list, so this guide applies to both.
Troubleshooting
“jobs.lua contains a job name with capital letters”
A top-level key in qbx_core/shared/jobs.lua has capitals. Change it to lower case and restart. The same check exists for gangs.lua.
Qbox: “cannot set job. Job … does not exist”
The name in /setjob is not in jobs.lua, or the server has not restarted since you added it. qbx_core prints cannot set job. Job %s does not have grade %s when only the grade is missing.
Qbox: “player already has maximum amount of jobs allowed”
/addjob refuses a job when the character already holds qbx:max_jobs_per_player jobs. Raise the convar or remove a job with /removejob.
Qbox: “You are not opted in for admin duty. (/optin to toggle)”
Type /optin in chat once. The admin permissions guide explains the opt-in and how to turn it off.
Qbox: “Invalid grade … found in player_groups table”
A character holds a grade that is missing from your file, often because grade keys have quotes or were renumbered. Put the grade back in the file before the next start: with qbx:cleanPlayerGroups on, qbx_core deletes such rows when it starts, and the character loses that rank. Migrating from QBCore to Qbox covers converting a whole QBCore jobs file.
ESX: “the job, grade or both are invalid”
/setjob checks that the job and grade exist in the loaded list. Run refreshjobs after inserting rows and use a grade number that is in job_grades.
ESX: “Invalid Argument Count (passed 2, wanted 3)”
ESX’s /setjob needs all three arguments. Add the grade: /setjob 23 taxi 0.
ESX: “Ignoring job … due to no job grades found”
The job is in jobs but no row in job_grades has its name in job_name. Add at least grade 0. es_extended also prints “Ignoring job grades for … due to missing job” in the reverse case.
ESX: a player’s job went back to unemployed after a restart
At login, es_extended prints Ignoring invalid job for ... and sets unemployed grade 0 when the stored job or grade no longer exists.
QBCore: the player’s rank shows “No Grades”
Player.Functions.SetJob accepted the job but found no grade with that key, so it set level 0 and payment 30. Use a grade that exists in jobs.lua.
Next Steps
- Add the work itself with a job script: FiveCrate’s job scripts category, and the script installation guide for installing one.
- Give the job a building: install an MLO, or browse FiveCrate’s MLO interiors.
- Add vehicles that only the job can take out: add cars to a police garage.
- Still choosing a framework: read QBCore vs Qbox vs ESX.
FiveM scripts from FiveCrate
Listed in the FiveCrate catalogue now.
Official documentation and repository references
- Qbox Docs: qbx_core Job type
- Qbox Docs: qbx_core Convars
- Qbox Docs: Migrating, Server setup (Jobs and gangs)
- qbx_core source: shared/jobs.lua (v1.24.1)
- QBCore Docs: Shared (Jobs and Gangs)
- ESX Docs: es_extended Commands
- ESX Docs: es_extended Server Functions (CreateJob)
- es_extended source: es_extended.sql (1.16.4)
Related guides
How to Add Cars to a FiveM Police Garage (Qbox, QBCore, ESX)
How to add cars to the police garage in FiveM: the vehicle list and grade rules of qbx_police, qb-policejob and esx_policejob, plus liveries, extras and EMS.
How to Install FiveM Scripts and Resources Safely
How to install FiveM scripts: check the files, put the folder in resources, add its dependencies and SQL, then set the ensure order in server.cfg.
How to Give Yourself Admin on QBCore, Qbox and ESX
How to give yourself admin on QBCore, Qbox and ESX Legacy: the add_principal lines, setgroup, /addpermission and /optin, plus fixes for Access denied errors.
How to Migrate QBCore to Qbox Safely (With a Rollback Plan)
Migrate QBCore to Qbox on a test copy: what carries over, the database and qb-inventory conversion commands, go-live day and a rollback plan from Qbox's docs.
QBCore vs ESX vs Qbox: Which FiveM Framework in 2026?
QBCore vs ESX vs Qbox in 2026, from official sources: what QBCore leaving FiveM means, how Qbox and ESX Legacy differ, and which framework fits your scripts.




