DarkRp CustomCheck Help

im in need of a custom check that would restrict certain job like “Pyro” unless there is at least someone with a firefighter job. The custom check i tried to figure out does not work and throws an error. I would REALLY appreciate some help. Thanks.

TEAM_PYRO = DarkRP.createJob(“Pyro”, {
color = Color(255, 0, 0, 255),
model = “models/player/mkx_jason.mdl”,
description = [[As a pyro you can purchase cheap molotov shipments.
Set those streets on fire!]],
weapons = {},
command = “pyro”,
max = 1,
salary = 45,
admin = 0,
vote = false,
hasLicense = false,
customCheck = function(ply) return ply:team.GetName(“TEAM_FIREFIGHTER”) > 1 end,

I have never seen this but you shouldent restrict a job

Well first off team.GetName() is for the actual name of the job and dosn’t work like you are trying to make it work. You don’t need the ply: part and you are also trying to use the enum as a string. Based on what you are trying to do this is my suggestion.

customCheck = function() return #team.GetPlayers(TEAM_FIREFIGHTER) > 1 end

Thank you very much! Works like a charm!!