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 =...