viniciusturko
New Member
Hello, I have a function that returns the item ids into a container. But I want that the function returns the slots where u can't find an item as 1 or nil.
For example, I have a container with a rope and a shovel, if I use my function, It will return just the id of the both tools, and not something like this : nil, nil, nil, rope, nil, nil shovel.
Can someone help me to make this function works?
Here is the function I'm using :
Rep ++
For example, I have a container with a rope and a shovel, if I use my function, It will return just the id of the both tools, and not something like this : nil, nil, nil, rope, nil, nil shovel.
Can someone help me to make this function works?
Here is the function I'm using :
Code:
function getIdsInContainer(containeruid)
local t = {}
for i = 0, (getContainerSize(containeruid)-1) do
local item = getContainerItem(containeruid, i)
table.insert(t, item.itemid)
end
return t
end
Rep ++