[Help] Trying to make store where you can pay for items or weapons with dirty money if anyone could point me in good direction I would really appreciate it
Hey thanks for fast reply. I get error
SCRIPT ERROR: @esx_blackmarket/server/main.lua:60: attempt to call a nil value (field ‘canCarryItem’)
That’s the code
– can the player afford this item?
if xPlayer.getAccount('black_money').money >= price then
-- can the player carry the said amount of x item?
-LINE60 -->> if xPlayer.canCarryItem(itemName, amount) then
xPlayer.removeAccountMoney('black_money', price)
xPlayer.addInventoryItem(itemName, amount)
xPlayer.showNotification(_U('bought', amount, itemLabel, ESX.Math.GroupDigits(price)))
else
xPlayer.showNotification(_U('player_cannot_hold'))
end
else
local missingMoney = price - xPlayer.getAccount('black_money').money
xPlayer.showNotification(_U('not_enough', ESX.Math.GroupDigits(missingMoney)))
end
end)
Sorry for the late reply, the reason you are getting this error is because your ESX version is out of date and not using the weight system, to fix the error you can update your ESX or just adapt the script to work with your version.
This is the version of ESX that should work.
Github
If I have a chance I’ll try converting it for you and sending it here
1 Like
Wow thanks a lot again I will let you know if its gonna work
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.