I try to find a solution for this error, can anyone help me?
the error lua:859: attempt to index a nil value (field ‘job’)
this is the line 859
if GRPCore.GetPlayerData().job.name == 'mechanic' then
and this is from 855 to 879
if nearbennyLocationLSC1 then
if not isPlyInBennys then
Draw3DText(bennyLocationLSC1.x, bennyLocationLSC1.y, bennyLocationLSC1.z + 0.5, "[Press ~p~E~w~ - Enter Los Santos Customs]", 255, 255, 255, 255, 4, 0.45, true, true, true, true, 0, 0, 0, 0, 55)
if IsControlJustReleased(1, 38) then
if GRPCore.GetPlayerData().job.name == 'mechanic' then
TriggerEvent('event:control:bennysmech', 1)
else
TriggerEvent('DoLongHudText', 'You are not a mechanic!', 2)
end
end
else
disableControls()
end
end
else
Wait(1000)
end
else
Wait(2000)
end
Citizen.Wait(1)
end
end)