LegacyFuel icon indicating copy to clipboard operation
LegacyFuel copied to clipboard

SCRIPT ERROR

Open Alphaputin opened this issue 4 years ago • 4 comments

SCRIPT ERROR: @LegacyFuel/source/fuel_server.lua:8: attempt to index a nil value (global 'ESX') pls help

Alphaputin avatar Jun 24 '20 12:06 Alphaputin

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

Alphaputin avatar Jun 24 '20 12:06 Alphaputin

Were you able to fix this issue?

andrewgonzalez4 avatar May 28 '21 18:05 andrewgonzalez4

Are you still having this issue? You most likely started LegacyFuel before you started ESX.

InZidiuZ avatar Jan 07 '22 21:01 InZidiuZ

https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent/#import

Geckomacabre avatar Feb 27 '23 12:02 Geckomacabre