local playerPos =
{
{x = 100, y = 100, z = 7},
{x = 101, y = 100, z = 7},
{x = 102, y = 100, z = 7},
{x = 103, y = 100, z = 7},
{x = 104, y = 100, z = 7},
{x = 105, y = 100, z = 7},
{x = 106, y = 100, z = 7},
{x = 107, y = 100, z = 7}
}
local newPos =
{
{x = 100, y = 100, z = 6},
{x = 101, y = 100, z = 6},
{x = 102, y = 100, z = 6},
{x = 103, y = 100, z = 6},
{x = 104, y = 100, z = 6},
{x = 105, y = 100, z = 6},
{x = 106, y = 100, z = 6},
{x = 107, y = 100, z = 6}
}
local itemID = 2323 --Change to RoS
local leverUID = 7575
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (leverUID == item.uid) then
for _, pos in ipairs(playerPos) do
pos.stackpos = 253
if not isPlayer(getThingFromPos(pos).uid) then
doPlayerSendCancel(cid, "Sorry, not Possible.")
return true
end
pos.stackpos = 2 --Change if necesary
pos.y = pos.y - 1 --1 sqm above player pos
if getThingFromPos(pos).itemid ~= itemID then
doPlayerSendCancel(cid, "Sorry, not Possible.")
return true
end
end
for k, pos in ipairs(playerPos) do
pos.stackpos = 253
doTeleportThing(getThingFromPos(pos).uid, newPos[k], false)
pos.stackpos = 2 --Change if necesary
pos.y = pos.y - 1 --1 sqm above player pos
doRemoveItem(getThingFromPos(pos).uid)
end
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
return true
end