InZidiuZ / LegacyFuel

A simple, lightweight fuel script for FiveM
GNU General Public License v3.0
78 stars 217 forks source link

SCRIPT ERROR #62

Open Alphaputin opened 4 years ago

Alphaputin commented 4 years ago

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

Alphaputin commented 4 years ago

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

andrewgonzalez4 commented 3 years ago

Were you able to fix this issue?

InZidiuZ commented 2 years ago

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

Geckomacabre commented 1 year ago

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