Hey guys i'm trying to create a anti-dupe system with basic attribute item give by the shop system of gesior acc.
Like the script gives a unique 'tid' to item and i'm trying to use this and the function created by Summ to remove items with the same 'tid' (unique id).
Function by Summ: otland.net/threads/function-get-all-items-by-id-get-all-items-in-slot-by-id.171981/
Shop by Gesior: http://otland.net/threads/gesior2012-items-shop-installation-administration.170654/
The script i'm trying to do:
The error on console:
I'm not good handling with tables on LUA, please i need help!
Thanks
Like the script gives a unique 'tid' to item and i'm trying to use this and the function created by Summ to remove items with the same 'tid' (unique id).
Function by Summ: otland.net/threads/function-get-all-items-by-id-get-all-items-in-slot-by-id.171981/
Shop by Gesior: http://otland.net/threads/gesior2012-items-shop-installation-administration.170654/
The script i'm trying to do:
Code:
function onThink(interval, lastExecution)
local Dupes = {}
for _, pid in ipairs(getPlayersOnline()) do
for _, item in pairs(getAllItemsById(pid, 2358)) do
if not Dupes[item] then
Dupes[item] = true
table.remove(item, item)
doRemoveItem(item.uid)
end
end
end
return true
end
The error on console:
[Error - GlobalEvent Interface]
data/globalevents/scripts/trackitems.luanThink
Description:
data/globalevents/scripts/trackitems.lua:9: bad argument #2 to 'remove' (number expected, got table)
stack traceback:
[C]: in function 'remove'
data/globalevents/scripts/trackitems.lua:9: in function <data/globalevents/scripts/trackitems.lua:1>
[Error - GlobalEvents::think] Couldn't execute event: removeitems
I'm not good handling with tables on LUA, please i need help!
Thanks