Open MrRiick10 opened 4 years ago
Same here. I got this for all drugs script i try. So ESX changed something
SCRIPT ERROR: @esx_drugs/server/main.lua:58: attempt to compare nil with number
TriggerServerCallback (@es_extended/server/functions.lua:33) handler (@es_extended/server/common.lua:89)
try changing xItem.limit to xItem.weight
That's the solution, changing (xItem.limit to xItem.weight) I tried it and it's working now, thank you.
esx_drugs/server/main.lua 58
To me you keep giving me the same mistake after putting it in weight, what can I do?
ESX.RegisterServerCallback('esx_illegal:canPickUp', function(source, cb, item) local xPlayer = ESX.GetPlayerFromId(source) local xItem = xPlayer.getInventoryItem(item)
if xItem.weight ~= -1 and xItem.count >= xItem.weight then
cb(false)
else
cb(true)
end
end)
esx_drugs/server/main.lua 58
To me you keep giving me the same mistake after putting it in weight, what can I do?
ESX.RegisterServerCallback('esx_illegal:canPickUp', function(source, cb, item) local xPlayer = ESX.GetPlayerFromId(source) local xItem = xPlayer.getInventoryItem(item)
if xItem.weight ~= -1 and xItem.count >= xItem.weight then cb(false) else cb(true) end
end)
This is what I have, but I can´t make a limit, I just keep harvesting infinitely.
local function HarvestCoke(source)
if CopsConnected < Config.RequiredCopsCoke then
TriggerClientEvent('esx:showNotification', source, _U('act_imp_police', CopsConnected, Config.RequiredCopsCoke))
return
end
SetTimeout(Config.TimeToFarm, function()
if PlayersHarvestingCoke[source] == true then
local xPlayer = ESX.GetPlayerFromId(source)
local coke = xPlayer.getInventoryItem('coke')
if coke.limit == 500 and coke.count == coke.limit then
TriggerClientEvent('esx:showNotification', source, _U('inv_full_coke'))
else
xPlayer.addInventoryItem('coke', 1)
HarvestCoke(source)
end
end
end)
end
SCRIPT ERROR: @esx_drugs/server/main.lua:58: attempt to compare nil with number