I'm trying to create a script in which I need to repeat this part of the code several times, but I know that TFS has a limit on repeating, for example "local", is there any way to insert the information into just one variable?
And yes, I already managed to reach the repetition limit trying to do it my way haha
Lua:
local t = {
Position(30629, 32466, 9),
Position(30628, 32466, 9),
Position(30627, 32466, 9),
Position(30626, 32458, 9),
Position(30626, 32457, 9),
Position(30626, 32457, 9)
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 9826 then
local tile = t[1]:getTile()
if tile then
local stone = tile:getItemById(1304)
if stone then
stone:remove()
t[1]:sendMagicEffect(CONST_ME_POFF)
end
end
local tile = t[2]:getTile()
if tile then
local stone = tile:getItemById(1304)
if stone then
stone:remove()
t[2]:sendMagicEffect(CONST_ME_POFF)
end
end
local tile = t[3]:getTile()
if tile then
local stone = tile:getItemById(1304)
if stone then
stone:remove()
t[3]:sendMagicEffect(CONST_ME_POFF)
end
end
...
And yes, I already managed to reach the repetition limit trying to do it my way haha