- Joined
- Apr 1, 2012
- Messages
- 1,249
- Solutions
- 71
- Reaction score
- 621
- Location
- Hell
- GitHub
- idontreallywolf
I am trying to send a reward to the depot of winner but for some reason Container:addItem[Ex] function does not work as expected.
This happens even tho there's an empty backpack in the first slot of depot.
How can I make it add the item into any INNER container (if there is any)?
I have tried both addItem and addItemEx. Didn't make a difference in my case.
This happens even tho there's an empty backpack in the first slot of depot.
How can I make it add the item into any INNER container (if there is any)?
I have tried both addItem and addItemEx. Didn't make a difference in my case.
Lua:
local depot = creature:getDepotChest(1)
if(depot) then
for i = 1, table.maxn(tempBoss.rewards), 1 do
print(tostring(depot:getEmptySlots(true))) -- shows 20 (which is true)
depot:addItem(tempBoss.rewards[i][1], tempBoss.rewards[i][2])
creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "You have received new reward items.")
end
creature:setStorageValue(tempBoss.storage, 1)
end