ESX_Society - withdraw/deposit works only for some factions

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

Yes i have the same issue its only working for my mafia job and for the rest of all my jobs not

Check your server.cfg you need run first esx_ stuff and then those factions.
I had few actions start before esx_society and others and this was causing problem.

1 Like

Thanks man, you helped me a lot, i just has to put society over the jobs on server.cfg! Really thanks man!