Hi, I was trying to remove an item with a heavy count of stacking items. I need to remove the item by count from the table on this element but it's not working as intended.
so the previous code ^ only removes 100 items and I don't know the reason
Also, I tried to use
to remove the count instead It also didn't work is there any idea that I can achieve this?
Lua:
local items_to_check = {
{id = 7372, count = 2000},
}
local TILE_POSITIONS = {
{x = 996, y = 996, z = 7},
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
for i = 1, #TILE_POSITIONS do
local tile = Tile(TILE_POSITIONS[i].x, TILE_POSITIONS[i].y, TILE_POSITIONS[i].z)
if tile then
for j = 1, #items_to_check do
local item = tile:getItemById(items_to_check[j].id)
if item then
item:remove()
end
end
end
end
end
Also, I tried to use
Code:
item:remove(items_to_check[j].count)