MagicHosting Logo
Back to blog

Magichosting

FiveM ESX Legacy: fix GetSharedObject error in shared.lua

E
Elias Bieber
Estimated reading time: 1 min

Older ESX resources crash due to the changed getSharedObject event? The callback fix in shared.lua gets your scripts running again – with code example.

FiveMESXGetSharedObjectLuaFix

Problem

In ESX Legacy the getSharedObject event was changed. Older resources cause errors.

Solution

Open: resources/[esx]/es_extended/shared/shared.lua

Replace the existing AddEventHandler for esx:getSharedObject with:

AddEventHandler("esx:getSharedObject", function(cb)
    cb(ESX)
end)

Save the file and restart the FiveM server. The error is fixed.

Was this post helpful?

MagicHosting – Hosting with real value

Hosting pays off with MagicHosting: fair pricing, current deals and reliable operation from Frankfurt. We offer servers, domains and personal support – no hidden costs.

  • Current special sales with discounts on servers and packages
  • Affordable domains with transparent pricing and great offers
  • Powerful DDoS protection for maximum availability
  • Personal support when you have questions or issues
Contact on WhatsApp