Lua error in job

Error I am getting in my jobs file


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

Right before the ',', Lua encountered something it could not make sense of.


Relevant bits of code:


category = "Civil Protection",
   customCheck = function(ply) if( CheckVIP(ply) or ply:IsSuperAdmin() ) then return true else return false end,
   customCheckFailMsg = "V.I.P job only"

This is where the error is happening in my job.


VIP = {
"VIP",
"Donator" 
} -- Put a , after each new VIP title except for the last one.

function CheckVIP(ply)
	if( table.HasValue(VIP, ply:GetUserGroup())) then
		return true
	else
		return false
	end
end

This is the function that is being used in the custom check.

I think you forgot to end your customcheck function:



customCheck = function(ply)
    if( CheckVIP(ply) or ply:IsSuperAdmin() ) then
        return true
    else
        return false
    end
-- where is the 'end' here?



customCheck = function(ply)
    if( CheckVIP(ply) or ply:IsSuperAdmin() ) then
        return true
    else
        return false
    end
    end


So you are saying it should be this?

That indentation is horrid (also why you messed up in the first place) but yes

Its a lot cleaner in ++. Just how it came out when I pasted it :stuck_out_tongue: Ok reuploading file to server. Update you in a minute.