Code:
local function scanContainer(cid, position)
local player = Player(cid)
if not player then
return
end
local corpse = Tile(position):getTopDownItem()
if not corpse or not corpse:isContainer() then
return
end
local playerId = player:getId()
if AutoLootList.players[playerId] == nil then
AutoLootList:save(playerId)
end
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
containerItem:moveTo(bag)
end
end
end
end
end
end
end
end
I'm trying to check this script
if you don't have cap you get a warning msg
but it turns out that even with or without cap only appears the warning msg