Hello everyone, I click on buy but nothing happens… Can anyone help me?
Check your errors also if you renamed the resource folder name it back to what the original name was otherwise the nui will break.
It says
SCRIPT ERROR: @esx_shop/server/main.lua:43: attempt to index a nil value (field ‘?’)
SCRIPT ERROR: @esx_shop/server/main.lua:60: attempt to call a nil value (field ‘canCarryItem’)
So are you using weight or limit. If its limit you need to fix the script to use limit instead of esx 1.2 weight
I’m using limit. How can I fix the script to use limit? I’m not the best in coding. Thanks
Either use an older commit of the resource before they moved to weight or use the following code in all places that has can carry.
local item = xPlayer.getInventoryItem(itemName)
if item.limit ~= -1 and (item.count + amount) > item.limit then
-- place notification here saying cant carry item
else
-- do all the other stuff here like take the money from the player and add the item to their inventory
end
I installed a previous version of the shop system and now it works correctly. Thanks you all of your help. Appreciate it.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.