TopllDanStar
New Member
- Joined
- Aug 4, 2014
- Messages
- 11
- Reaction score
- 0
I have a autoloot system for action, it is working only normal that has monsters that when I loot ai gives this error;
script
[08/10/201410:15:08][Error-ActionInterface][08/10/201410:15:08] data/actions/scripts/Autoloot.lua
nUse
[08/10/201410:15:08]Description:[08/10/201410:15:08](luaGetContainerSize)Containernot found
[08/10/201410:15:08][Error-ActionInterface][08/10/201410:15:08] data/actions/scripts/Autoloot.lua
nUse[08/10/201410:15:08]Description:[08/10/201410:15:08] data/actions/scripts/Autoloot.lua:8: attempt to perform arithmetic on a boolean value[08/10/201410:15:08] stack traceback:[08/10/201410:15:08] data/actions/scripts/Autoloot.lua:8:infunction<data/actions/scripts/Autoloot.lua:2>
[08/10/201410:15:08]Description:[08/10/201410:15:08](luaGetContainerSize)Containernot found
[08/10/201410:15:08][Error-ActionInterface][08/10/201410:15:08] data/actions/scripts/Autoloot.lua
script
--local toloot = {11441, 11441, 11443, 11444, 11445, 11446, 11447, 11448, 11449,11450, 11451, 11452, 11453, 11454, 12618, 12232, 12244}
function onUse(cid, item, frompos, item2, topos)
if getItemAttribute(item.uid, "corpseowner") ~= cid then
doPlayerSendCancel(cid, "You're not the owner.")
return true
end
local items = {}
for x=0, getContainerSize(item.uid) -1 do
local itens = getContainerItem(item.uid, x)
--if isInArray(toloot, itens.itemid) then
table.insert(items, {i=itens.itemid, q=itens.type})
doRemoveItem(itens.uid)
--break
--end
end
for y=1, #items do
doPlayerAddItemStacking(cid, items[y].i, items[y].q)
doPlayerSendTextMessage(cid, 20, "Looted "..items[y].q.."x "..getItemNameById(items[y].i)..".")
end
if #items > 0 then
return true
else
return false
end
end
function onUse(cid, item, frompos, item2, topos)
if getItemAttribute(item.uid, "corpseowner") ~= cid then
doPlayerSendCancel(cid, "You're not the owner.")
return true
end
local items = {}
for x=0, getContainerSize(item.uid) -1 do
local itens = getContainerItem(item.uid, x)
--if isInArray(toloot, itens.itemid) then
table.insert(items, {i=itens.itemid, q=itens.type})
doRemoveItem(itens.uid)
--break
--end
end
for y=1, #items do
doPlayerAddItemStacking(cid, items[y].i, items[y].q)
doPlayerSendTextMessage(cid, 20, "Looted "..items[y].q.."x "..getItemNameById(items[y].i)..".")
end
if #items > 0 then
return true
else
return false
end
end
Last edited: