1. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

Release Jobs.lua custom job error

Discussion in 'DarkRP Addon & Plugin Releases' started by Baseyoyoyo, Dec 29, 2016.

  1. Baseyoyoyo

    Baseyoyoyo New Member

    recently i have been adding custom jobs to my server and i have got to the stage where they all show up in the F4 menu and all work fine. Its just that now that i want to add them to categories to tidy them up i cant. I have followed multiple tutorials online telling me how to do it and each one goes down the same route of configuring the categories in categories.lua and then adding them to the custom jobs but this just results in a lua error for me and no jobs appearing.

    This is the error i get.
    [ERROR] Lua is unable to understand file "darkrp_customthings/jobs.lua" because its author made a mistake around line number 226.
    The best help I can give you is this:

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

    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 i have attached my jobs.lua file
     

    Attached Files:

  2. Syntax_Error

    Syntax_Error New Member

    This is the god damn wrong forum section however cause I wasn't busy I thought I'd take a look..


    Code (Text):
    -- Code generated with help from: TCB's DarkRP 2.5 Tools | www.thecodingbeast.com
    TEAM_MASTERTHIEF = DarkRP.createJob("Master Thief", {
        color = Color(159, 166, 161, 255),
        model = {"models/player/arctic.mdl"},
        description = [[You are a Master Thief! Your job is to commit crimes for a living. ]],
        weapons = {"m9k_ak47", "pro_lockpick"},
        command = "masterthief",
        max = 5,
        salary = 60,
        admin = 1,
        vote = false,
        hasLicense = false,
        customCheck = function(ply) return ply:GetNWString("usergroup") == "Donator"  or ply:GetNWString("usergroup") == "Super Donator"  or ply:GetNWString("usergroup") == "Owner"  or ply:GetNWString("usergroup") == "Developer"  or ply:GetNWString("usergroup") == "Co Owner"  or ply:GetNWString("usergroup") == "headadmin"  or ply:GetNWString("usergroup") == "admin"  end,
        CustomCheckFailMsg = "This job is a Donator only job!"
          category = "Donator",
       
        -- Insert customCheck here if you have one and want one.
    })
    Code (Text):
    -- Code generated with help from: TCB's DarkRP 2.5 Tools | www.thecodingbeast.com
    TEAM_MASTERTHIEF = DarkRP.createJob("Master Thief", {
        color = Color(159, 166, 161, 255),
        model = {"models/player/arctic.mdl"},
        description = [[You are a Master Thief! Your job is to commit crimes for a living. ]],
        weapons = {"m9k_ak47", "pro_lockpick"},
        command = "masterthief",
        max = 5,
        salary = 60,
        admin = 1,
        vote = false,
        hasLicense = false,
        customCheck = function(ply) return ply:GetNWString("usergroup") == "Donator"  or ply:GetNWString("usergroup") == "Super Donator"  or ply:GetNWString("usergroup") == "Owner"  or ply:GetNWString("usergroup") == "Developer"  or ply:GetNWString("usergroup") == "Co Owner"  or ply:GetNWString("usergroup") == "headadmin"  or ply:GetNWString("usergroup") == "admin"  end,
        CustomCheckFailMsg = "This job is a Donator only job!",
          category = "Donator"
       
        -- Insert customCheck here if you have one and want one.
    })
    Look at the difference. I can't be assed helping anymore.
     
  3. X. Cross

    X. Cross New Member

    Send me a steam message if you have not figured it out.
     
  4. bongLord

    bongLord New Member

    The CustomCheckFailMsg needed a comma and category doesn't need one
     

Share This Page