LegacyFuel
LegacyFuel copied to clipboard
SCRIPT ERROR
SCRIPT ERROR: @LegacyFuel/source/fuel_server.lua:8: attempt to index a nil value (global 'ESX') pls help
ESX = nil
if Config.UseESX then TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
RegisterServerEvent('fuel:pay')
AddEventHandler('fuel:pay', function(price)
local xPlayer = ESX.GetPlayerFromId(source)
local amount = ESX.Math.Round(price)
if price > 0 then
xPlayer.removeMoney(amount)
end
end)
end
Were you able to fix this issue?
Are you still having this issue? You most likely started LegacyFuel before you started ESX.
https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent/#import