auto-collection 3.6

Walox

New Member
Joined
Jul 31, 2017
Messages
15
Best answers
0
Reaction score
10
Hello everyone, I have a problem that I can not solve :/ my script is working 100% but it is giving error spam in my distro, could anyone help me? Please, I really need to sort this out.

[Error - Action Interface]
data/actions/scripts/Autoloot.lua:eek:nUse
Description:
(luaGetItemAttribute) Item not found
function onUse(cid, item, frompos, item2, topos, items)
--[[if getItemAttribute(item.uid, "corpseowner") ~= cid then
doPlayerSendCancel(cid, "You're not the owner.")
return true
end--]]
if getPlayerStorageValue(cid, 4919) < 1 then
return false
else
local items = {}
for i = 1, getTileInfo(frompos).things do
local n_pos = frompos
n_pos.stackpos = i
item = getTileThingByPos(n_pos)

if item and item.uid > 0 and getItemAttribute(item.uid, "corpseowner") then
if getItemAttribute(item.uid, "corpseowner") == cid then
for x=0, (getContainerSize(item.uid)) do
local itens = getContainerItem(item.uid, 0)
if itens and itens.uid > 0 and itens.itemid ~= 0 then
--if isInArray(toloot, itens.itemid) then
table.insert(items, {i=itens.itemid, q=itens.type})
doRemoveItem(itens.uid)
--break
--end
end
end
else
doPlayerSendCancel(cid, "You're not the owner.")
end
end
end

local itemsToLootAllWindow = {}
for y=1, #items do
local lootidclient = getItemInfo(items[y].i).clientId
local itt = ""..lootidclient.."|"..items[y].q.."|"
local ittt1, ittt2 = itt:explode("|")[1], itt:explode("|")[2]
local itr = ittt1 .."-".. ittt2 .."-"
table.insert(itemsToLootAllWindow, itr)
doPlayerAddItemStacking(cid, items[y].i, items[y].q)
doSendPlayerExtendedOpcode(cid, 60, table.concat(itemsToLootAllWindow))
end

if #items > 0 then
return true
else
return false
end
end
end

Thanks, I already thank you all.
 
Top