Code:
if AutoLootList.players[playerId] ~= nil then
local lootList = AutoLootList.players[playerId].lootList
if lootList ~= nil then
if corpse:getType():isCorpse() then
for a = corpse:getSize() - 1, 0, -1 do
local containerItem = corpse:getItem(a)
if containerItem then
local containerItemId = containerItem:getId()
for i=1, #lootList do
local lootItemId = lootList[i]
if lootItemId == containerItemId then
local item = ItemType(lootItemId)
containerItem:moveTo(backpack)
end
end
end
end
end
end
end
end
end
The problem i'm having is when the backpack slots are over he doesn't put the items into the next backpack he keeps putting the items in the backpack creating infinite slots