Appzyt
New Member
- Joined
- Jun 1, 2008
- Messages
- 92
- Reaction score
- 0
Lua:
local t = {
oldPosition = {
{x = 298, y = 447, z = 7},
{x = 298, y = 448, z = 7},
{x = 298, y = 449, z = 7},
{x = 298, y = 450, z = 7}
},
newPosition = {
{x = 303, y = 444, z = 7},
{x = 296, y = 442, z = 7},
{x = 298, y = 444, z = 7},
{x = 298, y = 440, z = 7}
}
}
local players = {}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 or item.itemid == 1946 then
for _, pos in ipairs(t.oldPosition) do
local c = getTopCreature(pos).uid
if c > 0 and isPlayer(c) then
table.insert(players, c)
end
end
if #players == 4 then
for i, v in ipairs(players) do
if getPlayerLevel(v) >= 100 then
doSendMagicEffect(t.oldPosition[i], CONST_ME_POFF)
doTeleportThing(v, t.newPosition[i], true)
doSendMagicEffect(t.newPosition[i], CONST_ME_TELEPORT)
else
doPlayerSendCancel(v, "All players need to reach X level.")
break
end
end
else
return doPlayerSendCancel(#players > 0 and players[1] or cid, "You need x players in x level or higher to be able to do this!")
end
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
No issues in gui but lever does not work when trying to pull it.