Unable to use job in function

When I do this:
PlayerData = ESX.GetPlayerData()
local dumped = ESX.DumpTable(PlayerData.job)
print(dumped)
end)

I get [“name”] = taxi

but when I try this:

– Check if player is in a Taxi
function IsInTaxi()
if PlayerData.job.name == ‘taxi’ then

it tell me im trying to index nil value in field job… why?

Thanks

local dumped = ESX.DumpTable(PlayerData.job.name)
print(dumped)

will print taxi on console
so why playerData.job.name == does not work ?
Thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.