The Lua coding for the jobs I've made are below.. For some reason, the line on the left connects anything after the "Plague Doctor" job, and I guess it labels it as one code.. Anyone know how to fix it?
--[[---------------------------------------------------------------------------
DarkRP custom jobs
---------------------------------------------------------------------------
This file contains your custom jobs.
This file should also contain jobs from DarkRP that you edited.
Note: If you want to edit a default DarkRP job, first disable it in darkrp_config/disabled_defaults.lua
Once you've done that, copy and paste the job to this file and edit it.
The default jobs can be found here:
https://github.com/FPtje/DarkRP/blob/ma ... elated.lua
For examples and explanation please visit this wiki page:
http://wiki.darkrp.com/index.php/DarkRP:CustomJobFields
Add jobs under the following line:
---------------------------------------------------------------------------]]
--Letter C
TEAM_POLICE = DarkRP.createJob("Police Officer", {
color = Color(25, 25, 170, 255),
model = {"models/player/police.mdl", "models/player/police_fem.mdl"},
description = [[The protector of every citizen that lives in the city.
You have the power to arrest criminals and protect innocents.
Hit a player with your arrest baton to put them in jail.
Bash a player with a stunstick and they may learn to obey the law.
The Battering Ram can break down the door of a criminal, with a warrant for their arrest.
The Battering Ram can also unfreeze frozen props (if enabled).
Type /wanted <name> to alert the public to the presence of a criminal.]],
weapons = {"arrest_stick", "unarrest_stick", "m9k_sig_p229r", "stunstick", "door_ram", "weaponchecker"},
command = "jobcp",
max = 4,
salary = GAMEMODE.Config.normalsalary * 1.45,
admin = 0,
vote = true,
hasLicense = true,
category = "Civil Protection",
})
TEAM_CHIEF = DarkRP.createJob("Police Chief", {
color = Color(20, 20, 255, 255),
model = "models/player/combine_soldier_prisonguard.mdl",
description = [[The Chief is the leader of the Civil Protection unit.
Coordinate the police force to enforce law in the city.
Hit a player with arrest baton to put them in jail.
Bash a player with a stunstick and they may learn to obey the law.
The Battering Ram can break down the door of a criminal, with a warrant for his/her arrest.
Type /wanted <name> to alert the public to the presence of a criminal.
Type /jailpos to set the Jail Position]],
weapons = {"arrest_stick", "unarrest_stick", "m9k_deagle", "stunstick", "door_ram", "weaponchecker"},
command = "chiefpolice",
max = 1,
salary = GAMEMODE.Config.normalsalary * 1.67,
admin = 0,
vote = false,
hasLicense = true,
chief = true,
NeedToChangeFrom = TEAM_POLICE,
category = "Civil Protection",
})
------------------------------------------------------------------------------------------
--Letter G
TEAM_GOD = DarkRP.createJob("The Plague Doctor", {
color = Color(255, 255, 255, 255),
model = "models/player/plague_doktor/player_plague_doktor.mdl",
description = [[The plague doctor cleanses the impure.]],
weapons = {"lockpick", "m9k_deagle"},
command = "God",
max = 1,
salary = 65,
admin = 0,
vote = false,
hasLicense = false
customCheck =function(ply)
return ply:SteamID()=="STEAM_0:1:42253897"
})
------------------------------------------------------------------------------------------
--Letter H
TEAM_HEAVYDEALER = DarkRP.createJob("Heavy Gun Dealer", {
color = Color(255, 140, 0, 255),
model = "models/player/monk.mdl",
description = [[A Heavy Gun Dealer is the only person who can sell guns to other people.
Make sure you aren't caught selling illegal firearms to the public! You might get arrested!]],
weapons = {},
command = "heavygundealer",
max = 2,
salary = GAMEMODE.Config.normalsalary,
admin = 0,
vote = true,
hasLicense = false,
category = "Citizens",
})
------------------------------------------------------------------------------------------
--Letter M
TEAM_MAYOR = DarkRP.createJob("Mayor", {
color = Color(150, 20, 20, 255),
model = "models/player/breen.mdl",
description = [[The Mayor of the city creates laws to govern the city.
If you are the mayor you may create and accept warrants.
Type /wanted <name> to warrant a player.
Type /jailpos to set the Jail Position.
Type /lockdown initiate a lockdown of the city.
Everyone must be inside during a lockdown.
The cops patrol the area.
/unlockdown to end a lockdown]],
weapons = {},
command = "jobmayor",
max = 1,
salary = GAMEMODE.Config.normalsalary * 1.89,
admin = 0,
vote = true,
hasLicense = false,
mayor = true,
category = "Civil Protection",
})
TEAM_MEDIC = DarkRP.createJob("Medic", {
color = Color(47, 79, 79, 255),
model = {
"models/player/Group03m/male_01.mdl",
"models/player/Group03m/female_01.mdl",
"models/player/Group03m/male_02.mdl",
"models/player/Group03m/female_02.mdl",
"models/player/Group03m/male_03.mdl",
"models/player/Group03m/female_03.mdl",
"models/player/Group03m/male_04.mdl",
"models/player/Group03m/female_04.mdl"
},
description = [[With your medical knowledge you work to restore players to full health.
Without a medic, people cannot be healed.
Left click with the Medical Kit to heal other players.
Right click with the Medical Kit to heal yourself.]],
weapons = {"med_kit"},
command = "jobmedic",
max = 3,
salary = GAMEMODE.Config.normalsalary,
admin = 0,
vote = false,
hasLicense = false,
medic = true,
category = "Citizens",
})
------------------------------------------------------------------------------------------
--Letter S
TEAM_SWAT = DarkRP.createJob("S.W.A.T Officer", {
color = Color(20, 20, 255, 255),
model = "models/player/urban.mdl",
description = [[The protector of every citizen that lives in the city.
You have the power to arrest criminals and protect innocents.
Hit a player with your arrest baton to put them in jail.
Bash a player with a stunstick and they may learn to obey the law.
The Battering Ram can break down the door of a criminal, with a warrant for their arrest.
The Battering Ram can also unfreeze frozen props (if enabled).
Type /wanted <name> to alert the public to the presence of a criminal.]],
weapons = {"arrest_stick", "unarrest_stick", "m9k_mp5sd", "stunstick", "door_ram", "weaponchecker"},
command = "swatofficer",
max = 1,
salary = GAMEMODE.Config.normalsalary * 1.67,
admin = 0,
vote = false,
hasLicense = true,
chief = true,
NeedToChangeFrom = TEAM_POLICE,
category = "Civil Protection",
})
TEAM_SWATSUP = DarkRP.createJob("S.W.A.T Support", {
color = Color(20, 20, 255, 255),
model = "models/player/swat.mdl",
description = [[The Chief is the leader of the Civil Protection unit.
Coordinate the police force to enforce law in the city.
Hit a player with arrest baton to put them in jail.
Bash a player with a stunstick and they may learn to obey the law.
The Battering Ram can break down the door of a criminal, with a warrant for his/her arrest.
Type /wanted <name> to alert the public to the presence of a criminal.
Type /jailpos to set the Jail Position]],
weapons = {"arrest_stick", "unarrest_stick", "m9k_m3", "stunstick", "door_ram", "weaponchecker"},
command = "swatsupport",
max = 1,
salary = GAMEMODE.Config.normalsalary * 1.67,
admin = 0,
vote = false,
hasLicense = true,
chief = true,
NeedToChangeFrom = TEAM_SWAT,
category = "Civil Protection",
})
TEAM_SUPERDEALER = DarkRP.createJob("Super Gun Dealer", {
color = Color(20, 20, 255, 255),
model = "models/player/fallout_3/tesla_power_armor.mdl",
description = [[***CUSTOM CLASS FOR TOMMYSHMOKES***
You are a gun dealer. You must sell to the public, but don't get caught selling illegal weaponry!
You can raid
You cannot Mug.
You can fight back during a mug.
You must sell to the public. ]],
weapons = {"m9k_deagle", "m9k_usas", "medkit"},
command = "superdealer",
max = 1,
salary = GAMEMODE.Config.normalsalary * 1.67,
admin = 0,
vote = false,
hasLicense = true,
category = "Citizens",
customCheck =function(ply)
return ply:SteamID()=="STEAM_0:0:91051494"
})
------------------------------------------------------------------------------------------
--Letter T
TEAM_THIEF = DarkRP.createJob("Thief", {
color = Color(0, 0, 0, 255),
model = "models//player/t_arctic.mdl",
description = [[You are a criminal. Dont get caught doing illegal actions!
You can mug
You can raid
You can base ONLY with other criminals]],
weapons = {"lockpick", "m9k_uzi", "m9k_coltpython"},
command = "thief",
max = 3,
salary = 50,
admin = 0,
vote = false,
hasLicense = false
category = "Citizens"
})
--[[---------------------------------------------------------------------------
Define which team joining players spawn into and what team you change to if demoted
---------------------------------------------------------------------------]]
GAMEMODE.DefaultTeam = TEAM_CITIZEN
--[[---------------------------------------------------------------------------
Define which teams belong to civil protection
Civil protection can set warrants, make people wanted and do some other police related things
---------------------------------------------------------------------------]]
GAMEMODE.CivilProtection = {
[TEAM_POLICE] = true,
[TEAM_CHIEF] = true,
[TEAM_MAYOR] = true,
[TEAM_SWAT] = true,
[TEAM_SWATSUP] = true
}
--[[---------------------------------------------------------------------------
Jobs that are hitmen (enables the hitman menu)
---------------------------------------------------------------------------]]
DarkRP.addHitmanTeam(TEAM_HITMAN, TEAM_ASSHOLE)
TEAM_HITMAN = DarkRP.createJob("Hitman", {
color = Color(0, 0, 0, 255),
model = "models/player/t_leet.mdl",
description = [[You are hired to kill anyone who is wanted dead. If you are wanted, you are KOS/AOS by governmental members.
You cannot mug
You cannot raid, unless your target is inside of a building.
You must have someone with a lockpick on your side in order to raid your target.
You can only base with other criminals.]],
weapons = {"m9k_m24", "m9k_hk45"},
command = "hitman",
max = 2,
salary = 50,
admin = 0,
vote = false,
hasLicense = false
})
TEAM_ASSHOLE = DarkRP.createJob("Assassin", {
color = Color(0, 0, 255, 0),
model = "models/player/kanade_tachibana.mdl",
description = [[You are hired to kill anyone who is wanted dead. If you are wanted, you are KOS/AOS by governmental members.
You cannot mug
You can fight back during a mug.
You cannot raid, unless your target is inside of a building.
You can only base with other criminals.]],
weapons = {"m9k_aw50", "m9k_glock", "lockpick"},
command = "hitman",
max = 2,
salary = 50,
admin = 0,
vote = false,
hasLicense = false
category = "Citizens"
customCheck =function(ply)
return ply:SteamID()=="STEAM_0:1:40920765"
})
This code is ruining all the jobs, as the only jobs that appear in the job menu are "Citizen" and "Hobo"
Please help!
DarkRP Job Lua coding not working!
-
- New to forums
- Posts: 2
- https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
- Joined: Fri Mar 20, 2015 4:46 pm
- CollinCraig
- A semi-regular
- Posts: 18
- Joined: Tue May 05, 2015 4:37 pm
Re: DarkRP Job Lua coding not working!
1) Please make sure you are using DarkRP-Modification addons that can be found here: https://github.com/FPtje/darkrpmodification
2) Are there any errors in console (client or server) once you run this script?
2) Are there any errors in console (client or server) once you run this script?
Known Languages:
-Java
-Lua
Goals: Nfo Support Staff Member
-Java
-Lua
Goals: Nfo Support Staff Member
Re: DarkRP Job Lua coding not working!
Check this out it might help http://wiki.darkrp.com/index.php/DarkRP:CustomJobFields
Also this might help your steam ID verification for the jobs http://wiki.darkrp.com/index.php/Donato ... figuration
Also this might help your steam ID verification for the jobs http://wiki.darkrp.com/index.php/Donato ... figuration
Re: DarkRP Job Lua coding not working!
You need a comma after "hasLicense = false". I.E.--Letter G
TEAM_GOD = DarkRP.createJob("The Plague Doctor", {
color = Color(255, 255, 255, 255),
model = "models/player/plague_doktor/player_plague_doktor.mdl",
description = [[The plague doctor cleanses the impure.]],
weapons = {"lockpick", "m9k_deagle"},
command = "God",
max = 1,
salary = 65,
admin = 0,
vote = false,
hasLicense = false
customCheck =function(ply)
return ply:SteamID()=="STEAM_0:1:42253897"
})
Code: Select all
hasLicense = false,
customCheck =function(ply),