Hello, I want to make script which teleport all players from the arena after using item with UID.
There is my script:
But it teleports only player who use this special UID, it should teleport all players from the arena. How can it be done?
There is my script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local tp = {
{x = 2458, y = 3145, z = 14},
{x = 2458, y = 3146, z = 14},
{x = 2458, y = 3147, z = 14}
}
if(item.uid == 4251) then
for x = 1741, 1748 do
for y = 2103, 2110 do
local pos = {x = x, y = y, z = getCreaturePosition(cid).z}
if(isPlayer(getTopCreature(pos).uid)) then
local tpx = tp[math.random(#tp)]
doTeleportThing(getTopCreature(pos).uid, tpx)
doSendMagicEffect(tpx, CONST_ME_TELEPORT)
end
end
end
end
return true
end
But it teleports only player who use this special UID, it should teleport all players from the arena. How can it be done?