ACTIONS
nome do seu script.lua
local t = {
lvl = 100,
entrada = {
{x = 710, y = 1420, z = 5}, -- pos players
{x = 709, y = 1420, z = 5},
{x = 708, y = 1420, z = 5},
{x = 707, y = 1420, z = 5}
},
saida = {
{x = 710, y = 1420, z = 6}, -- pos para onde eles irão
{x = 709, y = 1420, z = 6},
{x = 708, y = 1420, z = 6},
{x = 707, y = 1420, z = 6}
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local check = {}
for _, k in ipairs(t.entrada) do
local x = getTopCreature(k).uid
if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < t.lvl) then
doPlayerSendCancel(cid, 'Está faltando player ou alguém não possui level '..t.lvl..' ou mais.') return true
end
table.insert(check, x)
end
for i, tid in ipairs(check) do
doSendMagicEffect(t.entrada[i], CONST_ME_POFF)
doTeleportThing(tid, t.saida[i], false)
doSendMagicEffect(t.saida[i], CONST_ME_ENERGYAREA)
end
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
return true
end