Security HUD
System Watchdog
×
Threads Scanned
-- / --
SYS. LOAD --%
AI SHIELD ACTIVE
DMCA Policy
×

📋 DMCA Compliance

This platform and community fully complies with the Digital Millennium Copyright Act (DMCA) and international copyright laws. We take all copyright protection seriously.

🛡️ Copyright Protection

If you believe a posted item belongs to you or violates your copyright, you may file a DMCA takedown request through our official channels. Upon receiving a valid claim, the infringing content will be removed within 24 hours.

What's new
×
Fiveguard

Advertisement The dreaded attempt to index a nil value (global 'ESX') Error on FiveM Server

TwistedMe2u

Member
Joined
Jan 7, 2023
Messages
2
Reaction score
10
Points
156
Location
US
If you have your own FiveM server and you are running ESX platform; you have come across the error

attempt to index a nil value (global 'ESX')​

this is a ESX version issue for version greater than 1.9 and scripts that are attempting to retrieve ESX shared object in a way thats been depreciated. Please remove code in the files where the ESX object is being set to "nil" and the function usually right after it that is retrieving the shared object. Please see example bad code below

Code:
ESX = nil

 TriggerEvent(
     "esx:getSharedObject",
     function(obj)
         ESX = obj
     end
 )

Replace that code above with this code:

Code:
ESX = exports['es_extended']:getSharedObject()

Please like this if it helped you!!! THANKS!!! :)
 

Kennyata

Member
Joined
Dec 4, 2022
Messages
13
Reaction score
0
Points
156
Location
Spian
If you have your own FiveM server and you are running ESX platform; you have come across the error

attempt to index a nil value (global 'ESX')​

this is a ESX version issue for version greater than 1.9 and scripts that are attempting to retrieve ESX shared object in a way thats been depreciated. Please remove code in the files where the ESX object is being set to "nil" and the function usually right after it that is retrieving the shared object. Please see example bad code below

Code:
ESX = nil

 TriggerEvent(
     "esx:getSharedObject",
     function(obj)
         ESX = obj
     end
 )

Replace that code above with this code:

Code:
ESX = exports['es_extended']:getSharedObject()

Please like this if it helped you!!! THANKS!!! :)
nice work and ty for work!!!
 
Top