Code:
if TESTEAutoLootList.players[playerId] ~= nil then
local lootList = TESTEAutoLootList.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
if player:getFreeCapacity() > 100 and player:getStorageValue(9398329) == 0 then
containerItem:moveTo(bag)
elseif player:getFreeCapacity() > 100 and player:getStorageValue(9398329) == 1 then
containerItem:moveTo(player)
else
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, string.format(" It is too heavy or you have not enough space."))
end
end
end
end
end
end
end
end
end
I still have not had success even putting it to jump to the next option if the cap is less than 100 it ignores the check cap