LUA Errors

Kristo

Website & Software Developer
Feb 5, 2015
269
69
Hi All,

I have been developing a GMOD Server recently however I keep getting errors from my jobs.lua script everytime I copy it into the server files to work.

An Example of this error is ')' expected (to close '(' at line 51) near '='

My script is found below.
--[[---------------------------------------------------------------------------
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:


For examples and explanation please visit this wiki page:



Add jobs under the following line:
---------------------------------------------------------------------------]]

TEAM_CITIZEN = DarkRP.createJob("Citizen", {
color = Color(20, 150, 20, 255),
model = {
"models/player/Group01/Female_01.mdl",
"models/player/Group01/Female_02.mdl",
"models/player/Group01/Female_03.mdl",
"models/player/Group01/Female_04.mdl",
"models/player/Group01/Female_06.mdl",
"models/player/group01/male_01.mdl",
"models/player/Group01/Male_02.mdl",
"models/player/Group01/male_03.mdl",
"models/player/Group01/Male_04.mdl",
"models/player/Group01/Male_05.mdl",
"models/player/Group01/Male_06.mdl",
"models/player/Group01/Male_07.mdl",
"models/player/Group01/Male_08.mdl",
"models/player/Group01/Male_09.mdl"
},
description = [[The Citizen is the most basic level of society you can hold besides being a hobo. You have no specific role in city life.]],
weapons = {},
command = "citizen",
max = 0,
salary = GAMEMODE.Config.normalsalary,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Citizens",
})

TEAM_SS = DarkRP.createJob("Secret Service", {
color = Color(100, 20, 20, 255),
model = "models/lt_c/sci_fi/humans/male_bill.mdl" },
description = [[You are responsible for protecting the mayor.]],
weapons = {"weapon_deagle2", "stunstick", "weaponchecker"},
command = "ss",
max = 2,
salary = 100,
admin = 0,
vote = true,
hasLicense = false,
ammo = {
["pistol"] = 60,
},
category = "Citizens",
})

TEAM_SWAT = DarkRP.createJob("SWAT", {
color = Color(25, 25, 170, 255),
model = {"models/player/imc_grunt_anti_titan.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_m92beretta", "stunstick", "door_ram", "weaponchecker", "handcuffs"},
command = "Swat",
max = 4,
salary = 150,
admin = 0,
vote = true,
hasLicense = true,
help = {
"Please don't abuse your job",
"When you arrest someone they are auto transported to jail.",
"They are auto let out of jail after some time",
"Type /warrant [Nick|SteamID|Status ID] to set a search warrant for a player.",
"Type /wanted [Nick|SteamID|Status ID] to alert everyone to a wanted suspect",
"Type /unwanted [Nick|SteamID|Status ID] to clear the suspect",
"Type /jailpos to set the jail position"
},
category = "Citizens",
})

TEAM_MOD = DarkRP.createJob("Moderator on Duty", {
color = Color(150, 20, 20, 255),
model = "models/player/masterchiefh2.mdl",
description = [[]],
weapons = {},
command = "modd",
max = 0,
salary = 550,
admin = 0,
vote = false,
hasLicense = false,
category = "Staff",
customCheck = function(ply) return
table.HasValue({"moderator","superadmin"}, ply:GetNWString("usergroup"))
end,
CustomCheckFailMsg = "This Job Is For Staff Only!",
})

TEAM_MD = DarkRP.createJob("Mayors Daughter", {
color = Color(255,100,100,255),
model = "models/lt_c/sci_fi/humans/female_wraith.mdl",
description = [[You are the mayors daughter, walk around with your dad
just chill around. But be careful, you never know when somebody
is waiting to kidnap you!]],
weapons = {},
command = "mayorsdaughter",
max = 1,
salary = 50,
admin = 0,
vote = false,
hasLicense = false
category = "Citizens"
})

TEAM_GUARD = DarkRP.createJob("Guard", {
color = Color(0,200,50,255),
model = "models/player/guard_pack/guard_01.mdl",
"models/player/guard_pack/guard_02.mdl",
description = [[People will pay for protection, use your weapon or buy one from the local gundealer.]],
weapons = {"weapon_deagle2"},
command = "guard",
max = 1,
salary = 90,
admin = 0,
vote = false,
hasLicense = true,
category = "Citizens",
})

TEAM_JUH = DarkRP.createJob("Juggernaut", {
color = Color(20, 20, 255, 255),
model = "models/player/lordvipes/me2_legion/legion_cvp.mdl",
description = [[]],
weapons = {"m9k_minigun"}, -- You may wanna find a pickpocket swep and add it here.
command = "jug",
max = 1,
salary = 200,
admin = 0,
vote = true,
hasLicense = false,
category = "Citizens",
PlayerSpawn = function(ply) ply:SetHealth(500) end,
})

TEAM_SWATL = DarkRP.createJob("SWAT Leader", {
color = Color(20, 20, 255, 255),
model = {"models/player/imc_grunt_anti_titan.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_m92beretta", "stunstick", "door_ram", "weaponchecker", "handcuffs"},
command = "SwatL",
max = 1,
salary = 240,
admin = 0,
vote = true,
hasLicense = true,
help = {
"Please don't abuse your job",
"When you arrest someone they are auto transported to jail.",
"They are auto let out of jail after some time",
"Type /warrant [Nick|SteamID|Status ID] to set a search warrant for a player.",
"Type /wanted [Nick|SteamID|Status ID] to alert everyone to a wanted suspect",
"Type /unwanted [Nick|SteamID|Status ID] to clear the suspect",
"Type /jailpos to set the jail position"
},
category = "Citizens",
})

TEAM_POLICES = DarkRP.createJob("Police Officer", {
color = Color(34, 52, 211, 255),
model = {"models/ninja/beffect/quarfrog.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]],
weapons = {"arrest_stick", "unarrest_stick", "m9k_m92beretta", "stunstick", "door_ram", "weaponchecker", "handcuffs"},
command = "polices",
max = 10,
salary = 100,
admin = 0,
vote = true,
hasLicense = true,
candemote = true,
-- CustomCheck
medic = false,
chief = false,
mayor = false,
hobo = false,
cook = false,
category = "Citizens",
})

TEAM_SWATM = DarkRP.createJob("S.W.A.T Medic", {
color = Color(80, 45, 0, 255),
model = "models/ninja/beffect/titanfall_dm_quarian_f.mdl",
description = [[This is a donator special job,
your duty is to heal on of your
wounded operatives. You should stay in the PD
until backup is needed.
Do everything you can to keep the city safe.
You also keep your team healed.]],
weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "weapon_ak472", "ls_sniper", "weapon_m42", "weapon_mp52", "stunstick", "door_ram", "weaponchecker", "med_kit"},
command = "swatm",
max = 3,
salary = 450,
admin = 0,
vote = true,
category = "Citizens",
hasLicense = true,

})

TEAM_SWATS = DarkRP.createJob("Swat Sniper", {
color = Color(20, 20, 255, 255),
model = "models/player/imc_grunt_anti_titan.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_m92beretta", "stunstick", "door_ram", "weaponchecker", "handcuffs"},
command = "SwatS",
max = 1,
salary = 350,
admin = 0,
vote = true,
hasLicense = true,
help = {
"Please don't abuse your job",
"When you arrest someone they are auto transported to jail.",
"They are auto let out of jail after some time",
"Type /warrant [Nick|SteamID|Status ID] to set a search warrant for a player.",
"Type /wanted [Nick|SteamID|Status ID] to alert everyone to a wanted suspect",
"Type /unwanted [Nick|SteamID|Status ID] to clear the suspect",
"Type /jailpos to set the jail position"
},
category = "Citizens",
})

TEAM_MTHIEF = DarkRP.createJob("Master Thief", {
color = Color(0, 0, 0, 255),
model = "models/mark2580/mass_effect_3/me3_kasumi_goto_player.mdl",
description = [[You are a thief, rob people, lockpick their house and steal their plants and legal printers.]],
weapons = {"lockpick", "m9k_tec9", "pickpocket "}, -- You may wanna find a pickpocket swep and add it here.
command = "mthief",
max = 4,
salary = 110,
admin = 0,
vote = false,
hasLicense = false,
category = "Citizens",
})

TEAM_ADMIN = DarkRP.createJob("Administrator on Duty", {
color = Color(150, 20, 20, 255),
model = "models/player/masterchiefh2_blue.mdl",
description = [[]],
weapons = {},
command = "saod",
max = 0,
salary = 550,
admin = 0,
vote = false,
hasLicense = false,
category = "Staff",
customCheck = function(ply) return
table.HasValue({"administrator","superadmin",}, ply:GetNWString("usergroup"))
end,
CustomCheckFailMsg = "This Job Is For Staff Only!",
})

TEAM_OWNER = DarkRP.createJob("Owner", {
color = Color(150, 20, 20, 255),
model = "models/player/jane_shepard.mdl",
description = [[]],
weapons = {},
command = "ood",
max = 0,
salary = 5000,
admin = 0,
vote = false,
hasLicense = false,
category = "Staff",
customCheck = function(ply) return
table.HasValue({"superadmin",}, ply:GetNWString("usergroup"))
end,
CustomCheckFailMsg = "This Job Is For Staff Only!",
})

TEAM_HOS = DarkRP.createJob("Head of Staff", {
color = Color(150, 20, 20, 255),
model = "models/player/masterchiefh2_red.mdl",
description = [[]],
weapons = {},
command = "hos",
max = 0,
salary = 550,
admin = 0,
vote = false,
hasLicense = false,
category = "Staff",
customCheck = function(ply) return
table.HasValue({"hos", "superadmin",}, ply:GetNWString("usergroup"))
end,
CustomCheckFailMsg = "This Job Is For Staff Only!",
})

TEAM_DPT = DarkRP.createJob("Bus Driver", {
color = Color(150, 20, 20, 255),
model = "models/player/combine_super_soldier.mdl",
description = [[]],
weapons = {},
command = "bd",
max = 6,
salary = 550,
admin = 0,
vote = false,
hasLicense = false,
category = "Citizens",
customCheck = function(ply) return
table.HasValue({"transport",}, ply:GetNWString("usergroup"))
end,
CustomCheckFailMsg = "This Job Is For Staff Only!",
})

TEAM_NGUN = DarkRP.createJob("Gun Dealer", {
color = Color(255, 140, 0, 255),
model = "models/player/scifi_male_06.mdl",
description = [[A 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 = "gundealer",
max = 2,
salary = GAMEMODE.Config.normalsalary,
admin = 0,
category = "Citizens",
vote = false,
hasLicense = false,
})

TEAM_SGUN = DarkRP.createJob("Supreme Gun Dealer", {
color = Color(255, 140, 0, 255),
model = "models/wrex/wrex.mdl",
description = [[A 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 = "sgundealer",
max = 2,
salary = 500,
admin = 0,
vote = true,
category = "Citizens",
hasLicense = false,
})

TEAM_MAYOR = DarkRP.createJob("Mayor", {
color = Color(150, 20, 20, 255),
model = "models/rottweiler/freeman.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 = "mayor",
max = 1,
salary = GAMEMODE.Config.normalsalary * 1.89,
admin = 0,
vote = true,
hasLicense = false,
mayor = true,
category = "Citizens",
})

TEAM_GANG = DarkRP.createJob("Gangster", {
color = Color(75, 75, 75, 255),
model = {
"models/fearless/don1.mdl",
description = [[The lowest person of crime.
A gangster generally works for the Mobboss who runs the crime family.
The Mob boss sets your agenda and you follow it or you might be punished.]],
weapons = {},
command = "gangster",
max = 3,
salary = GAMEMODE.Config.normalsalary,
admin = 0,
vote = false,
hasLicense = false,
category = "Citizens",
})

TEAM_MOB = DarkRP.createJob("Mob boss", {
color = Color(25, 25, 25, 255),
model = "models/fearless/bsuit04.mdl",
description = [[The Mob boss is the boss of the criminals in the city.
With his power he coordinates the gangsters and forms an efficient crime organization.
He has the ability to break into houses by using a lockpick.
The Mob boss posesses the ability to unarrest you.]],
weapons = {"lockpick", "unarrest_stick"},
command = "mobboss",
max = 1,
salary = GAMEMODE.Config.normalsalary * 1.34,
admin = 0,
vote = false,
hasLicense = false,
category = "Citizens",
})

TEAM_HOBO = DarkRP.createJob("Hobo", {
color = Color(80, 45, 0, 255),
model = "models/husk/slow.mdl",
description = [[The lowest member of society. Everybody laughs at you.
You have no home.
Beg for your food and money
Sing for everyone who passes to get money
Make your own wooden home somewhere in a corner or outside someone else's door]],
weapons = {"weapon_bugbait"},
command = "hobo",
max = 5,
salary = 0,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
hobo = true,
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,
}

--[[---------------------------------------------------------------------------
Jobs that are hitmen (enables the hitman menu)
---------------------------------------------------------------------------]]
DarkRP.addHitmanTeam(TEAM_MOB)

 

JMS

Posting Freak
Aug 25, 2014
562
270

Use this and you literally cant go wrong

EDIT: <-- Hit up this guy, he's a pro with lua
 
Last edited:

Ecko

23:37 [autobots] -!- eckostylez [[email protected]]
Nov 25, 2012
1,398
962
The part in blue is missing an opening curly bracket
TEAM_SS = DarkRP.createJob("Secret Service", {
color = Color(100, 20, 20, 255),
model = "models/lt_c/sci_fi/humans/male_bill.mdl" },
description = [[You are responsible for protecting the mayor.]],
weapons = {"weapon_deagle2", "stunstick", "weaponchecker"},
command = "ss",
max = 2,
salary = 100,
admin = 0,
vote = true,
hasLicense = false,
ammo = {
["pistol"] = 60,
},
category = "Citizens",
})
Change it to
Code:
model = { "models/lt_c/sci_fi/humans/male_bill.mdl" },
 

Ecko

23:37 [autobots] -!- eckostylez [[email protected]]
Nov 25, 2012
1,398
962
Most of the custom jobs has this issue that ecko stated.
If it's just one line, it doesn't really need to be wrapped around {}. Since the line already a closing curly bracket, I advised to make sure there is a corresponding opening one as well. Another fix could just be to remove the closing curly bracket.
 

Users who are viewing this thread

Top