HI
I have problem with esx society.
factions like taxi, pdm and illegal factions can use it without problem.
ambulance and pd cant.
This error
Error running system event handling function for resource esx_society: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:92: attempt to index a nil value (local ‘society’)
line 92 is “if xPlayer.job.name ~= society.name then…”
I checked and compared taxi script and ambulance script and its same:
if data.current.value == 'boss_actions' then
TriggerEvent('esx_society:openBossMenu', 'ambulance', function(data, menu)
menu.close()
vs
elseif data.current.value == 'boss_actions' then
TriggerEvent('esx_society:openBossMenu', 'taxi', function(data, menu)
menu.close()
I even tried print xPlayer.job.name in esx_society right before its used on line 92… and it printed ambulance, which is right name for society.
So why its NIL?
When I tried remove that line 92 and just let it go without checking for job name, it ended with error in esx addonaccount error "nil value local society "
in ESX there is local society = GetSociety(society)
I really dont get it… why one faction is working and another not. when its using same script and same calling?
Thanks