Hi,
I can no longer put or take items out of the trunk. I use inventoryhud for my standard inventory and it works completely fine, it’s just the trunk that does not work. It throws up these errors:
https://gyazo.com/2ebcfe2027bc2d78c28b049e64135f38
it’s attempting to index a nil value, but I’m not sure why?
Any help appreciated.
Line 347:
if (getTotalInventoryWeight(plate) + (getItemWeight(item) * count)) > max then
TriggerClientEvent(
“pNotify:SendNotification”,
_source,
{
text = _U(“insufficient_space”),
type = “error”,
queue = “trunk”,
timeout = 3000,
layout = “bottomCenter”
}
)
else
Line 138:
if type == “item_standard” then
local targetItem = xPlayer.getInventoryItem(item)
if targetItem.limit == -1 or ((targetItem.count + count) <= targetItem.limit) then
TriggerEvent(
“esx_trunk:getSharedDataStore”,
plate,
function(store)
local coffre = (store.get(“coffre”) or {})
for i = 1, #coffre, 1 do
if coffre[i].name == item then
if (coffre[i].count >= count and count > 0) then
xPlayer.addInventoryItem(item, count)
if (coffre[i].count - count) == 0 then
table.remove(coffre, i)
else
coffre[i].count = coffre[i].count - count
end