General > Developers Corner
Request assistance with a darkrp command
(1/1)
WE_BRAIN_HURT:
[ERROR] Lua is unable to understand file "darkrp_customthings/jobs.lua" because its author made a mistake around line number 761.
The best help I can give you is this:
There is an opening '{' bracket at line 747, but this bracket is never closed or not closed in time. It was expected to be closed before the 'customCheck' at line 761.
Hints:
- Did you forget a comma?
- All open brackets ({, (, [) must have a matching closing bracket. Are you sure it's there?
- Brackets must be opened and closed in the right order. This will work: ({}), but this won't: ({)}.
------- End of Simplerr error -------
For this coding:
TEAM_POLICE = DarkRP.createJob("Spider-Man Black Suited", {
color = Color(255, 0, 0, 255),
VIPOnly = true,
model = {"models/player/raimispiderblack.mdl"},
description = [[Do not be afk in this job!]],
weapons = {"keys", "pocket", "spiderman's_swep", "weapon_lightsaber", "arrest_stick", "weapon_cuff_standard", "weapon_arc_atmcard"},
command = "spiderman3",
max = 1,
salary = 400,
admin = 0,
vote = false,
hasLicense = true,
candemote = false,
category = "Civil Protection"
customCheck = function(ply) return ply:GetNWString("usergroup") == "vip" or ply:IsAdmin() end, -- The extra check function. Enter nil or nothing to not have a restriction
})
-Please Help
JamminR:
First, I changed your topic title.
Most people "need help"
We know that. That's why many are here.
In the future, Make a better topic title that describes in a few words what the issue is you need help with.
The person who gave you those answers gave you all you'd need to know.
We can't help unless we were to see the entire file.
Line 761?
You've only shown us a few lines.
Get a good text editor that will highlight lua (and other) programming syntax. I personally use notepad++, which even highlights the beginning and ending brackets and shows me if I have them in a wrong order.
EDIT - my guess is you forgot a comma, you figure out where.
You've not given enough information for us to know 100% that is the issue though.
An Error Has Occurred!
array_keys(): Argument #1 ($array) must be of type array, null given
[0] Board index
Go to full version