[HELP] esx_inventoryhud_trunk

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

Hi, saw this lingering in here, had the same issue. For some reason it cannot find the targetItem.limit, the only fix right now on that line 138 is to probably set it like… <= 9000 instead of targetItem.limit.

Hope this helps at least a tiny bit (: It will get it to be functional, it’s not perfect by any means.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.