DarkRP jobs.lua: annotated
Five real job definitions with every field explained. Copy the patterns, swap in your server's weapons and models, and understand what each line actually does before you change it.
DarkRP 2.9.x · File path: addons/[server]_darkrpmodification/lua/darkrp_customthings/jobs.lua
-- Generated by Zeros Host. Each field is annotated.-- File location: addons/[server]_darkrpmodification/lua/darkrp_customthings/jobs.luaTEAM_CITIZEN = DarkRP.createJob("Citizen", {color = Color(80, 160, 255),-- Colour shown in the F4 job list and scoreboard.model = {"models/player/Group01/male_07.mdl"},-- One or more player model paths. Multiple = random on spawn.description = [[Default job. Earn salary every minute. Buy a Money Printer (F4 > Entities, $5,000,000) to make passive income.]],-- Shown in F4. Keep it under 3 lines; walls of text are never read.weapons = {},-- Class names of weapons given on spawn. Empty = fists only.command = "citizen",-- /citizen in chat changes job. Must be unique across all jobs.max = 0,-- 0 = unlimited slots. Set a positive integer to cap this job.salary = 100,-- DarkRP dollars paid every DarkRP salary interval (default 5 min).admin = 0,-- 0 = any player. 1 = superadmin only. 2 = admin+. Use customCheck for VIP gates.vote = false,-- If true, a server-wide vote is required before the player can join this job.hasLicense = false,-- If true, the player needs a gun licence (from a Gun Dealer) to legally own weapons.category = "Citizen",-- Groups jobs in the F4 UI. The category name must match a DarkRP.createCategory() call.})TEAM_THIEF = DarkRP.createJob("Thief", {color = Color(180, 60, 60),-- Red hue signals criminal intent in the F4 list.model = {"models/player/Group03/male_01.mdl"},description = [[Rob players and raid bases using lockpicks. Criminal job: you can be raided and arrested.]],-- Call out raid risk explicitly; new players are often surprised by it.weapons = {"lockpick", "weapon_physgun"},-- lockpick = DarkRP built-in. weapon_physgun lets them move props during raids.command = "thief",max = 4,-- Caps at 4 simultaneous Thieves to prevent raid-stacking.salary = 75,-- Lower than Citizen; the risk/reward is in what they steal.admin = 0,vote = false,hasLicense = false,canDemote = true,-- Victims can initiate a community vote to remove this player from the job.category = "Criminal",})TEAM_THIEF_VIP = DarkRP.createJob("Thief VIP", {color = Color(220, 80, 80),model = {"models/player/Group03/male_09.mdl"},description = [[Upgraded Thief with a Pro Lockpick. VIP-exclusive. Earns higher salary and has an extra weapon slot.]],weapons = {"pro_lockpick", "weapon_physgun"},-- pro_lockpick = faster pick; depends on your lockpick addon.command = "vipthief",max = 2,salary = 150,admin = 0,-- Still 0; VIP check is done in customCheck, not admin level.vote = false,hasLicense = false,canDemote = true,category = "Criminal",-- customCheck gates the job behind any arbitrary Lua condition.-- Called with (ply, [reason]): return false to block, true to allow.-- The second return value is the denial message shown to the player.customCheck = function(ply)-- sam.HasRank checks the SAM admin mod rank table.-- Replace with your VIP check: ULib, Pointshop usergroups, etc.return sam.HasRank(ply, "vip"), "This job requires VIP rank."end,})TEAM_GUN = DarkRP.createJob("Gun Dealer", {color = Color(180, 130, 60),model = {"models/player/Group01/male_05.mdl"},description = [[Sell weapons to other players using F3 or your shipment entities. Civilian job: you cannot be raided unless you are basing with criminals.]],-- Clarify raid immunity; it is a common misconception that dealers are always safe.weapons = {"weapon_physcannon"},-- Gravity gun for moving shipment crates around a shop.command = "gundealer",max = 3,salary = 65,-- Low salary; income comes from player sales.admin = 0,vote = false,hasLicense = true,-- Gun Dealers are the source of gun licences in DarkRP.category = "Civilian",})TEAM_POLICE = DarkRP.createJob("Police Officer", {color = Color(100, 140, 220),model = { "models/player/Group01/male_01.mdl", "models/player/Group01/female_01.mdl", },-- Multiple models: GMod picks one at random each spawn.description = [[Arrest criminals, protect the Mayor, and enforce the law. Use your arrest baton to detain suspects. Do NOT arrest without warrant or reason.]],weapons = { "arrest_stick", "unarrest_stick", "weapon_stunstick", "weapon_cuff_police", },-- arrest_stick/unarrest_stick are DarkRP builtins. weapon_cuff_police = handcuff addon.command = "police",max = 8,salary = 150,-- Salary reflects the policing grind: long patrols, low direct income.admin = 0,vote = false,hasLicense = true,canDemote = false,-- Prevent criminals demoting officers to escape enforcement.category = "Government",-- PlayerSpawn fires each time this job spawns (including respawn).-- Use it to set DarkRP metadata: wanted status, salary multipliers, etc.PlayerSpawn = function(ply)ply:SetArmor(50) -- Start with 50 armourend,})-- Categories must be declared before the jobs that reference them.-- In practice, put this block at the top of your jobs.lua file.DarkRP.createCategory("Citizen", { color = Color(100, 180, 255), canSee = true, sortUp = true })DarkRP.createCategory("Civilian", { color = Color(180, 220, 100), canSee = true, sortUp = true })DarkRP.createCategory("Criminal", { color = Color(220, 80, 80), canSee = true, sortUp = true })DarkRP.createCategory("Government", { color = Color(100, 140, 220), canSee = true, sortUp = true })-- canSee = false hides the category from non-admin players in F4.-- sortUp = true pins the category toward the top of the list.
customCheck
Gate any job behind a Lua condition: VIP rank, playtime, prestige level, or anything you can query at runtime.
PlayerSpawn
Runs every time a player spawns into this job. Use it to grant armour, set DarkRP metadata, or teleport to a spawn point.
canDemote
Controls whether other players can vote to remove someone from this job. Disable for government roles, enable for criminals.
hasLicense
When true, the player's weapons are legal only if they hold a gun licence. Gun Dealers and Mayors typically grant these.
Running your own DarkRP server? Zeros Host handles the hardware, DDoS mitigation, and one-click GMod egg deployment. Drop in your jobs.lua and go. See our GMod hosting plans →