for an newbie to lua it is
im willing to learn stuff. And always comparing also stuff then. But im stuck with the money part. its not user its xPlayer for ESX but seems like im to stupid for it
LS Customs status: [{“locked”:false},{“locked”:false},{“locked”:true},{“locked”:false},{“locked”:false}]
Error running system event handling function for resource fcustoms: citizen:/scripting/lua/scheduler.lua:39: Failed to execute thread: server.lua:4: attempt to index a nil value (global ‘ESX’)
heres an example for frfuel to pay with ESX:
fuelCost = 55
RegisterServerEvent('frfuel:fuelAdded')-- fuel events
AddEventHandler('frfuel:fuelAdded', function(amount) --fuelAmount
TriggerEvent('es:getPlayerFromId', source, function(xPlayer)
if (xPlayer) then
local cost = (fuelCost)
xPlayer.removeMoney(cost)
else
TriggerEvent("es:desyncMsg")
end
end)
end)