Author Topic: Im having trouble with a lua problem  (Read 1708 times)

0 Members and 1 Guest are viewing this topic.

Offline thedep

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Im having trouble with a lua problem
« on: January 12, 2016, 04:41:26 PM »
In console it says this
[ERROR] Lua is unable to understand file "darkrp_customthings/jobs.lua" because its author made a mistake around line number 611.
The best help I can give you is this:

There is an opening '{' bracket at line 589, but this bracket is never closed or not closed in time. It was expected to be closed before the 'end' at line 611.

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 -------


and here is the job         


TEAM_TERRIOST = DarkRP.createJob("Terriost", {
   color = Color(252, 12, 12, 255),
   model = {"models/player/kuma/alqaeda_commando.mdl",
   "models/player/kuma/taliban_bomber.mdl",
   "models/player/kuma/taliban_rpg.mdl",
   "models/player/kuma/taliban_grunt.mdl"},
   description = [[You Are A Terriost Do Terror and blow up people you have a 10 minute cooldown]],
   weapons = {m9k_ak74,"m9k_suicide_bomb"},
   command = "terrorist",
   max = 1,
   salary = 25,
   admin = 0,
   vote = false,
   hasLicense = false,
   candemote = true,
   -- CustomCheck
   medic = false,
   chief = false,
   mayor = false,
   hobo = false,
   cook = false,
   category = "Citizens",
 customCheck = function(ply) return ply:GetNWString("usergroup") == "bronze" end  or ply:GetNWString("usergroup") == "silver" end  or ply:GetNWString("usergroup") == "gold" })end



idk how to fix it plz help


Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Im having trouble with a lua problem
« Reply #1 on: January 12, 2016, 07:12:06 PM »
First, I'd recommend getting an editor that does lua (and other language) syntax matching. It would show when you have broken brackets, or when you're trying to end too soon/late before or after a bracket.
Second, you have too many 'end's in the customcheck line.
"blah end or blah end or" should be "blah or blah or blah end"
Third, go from there.

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming