ESX error global 'esx'

I have this problem


make sure in the files you got an error for it has this at the top:

ESX = nil

Then make sure it has all of the locals for each script if it still errors after the above.

Look for this code in the clien/main.lua

Citizen.CreateThread(function()
	while ESX == nil do
		TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
		Citizen.Wait(0)
	end

And replace it with

TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
2 Likes

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