• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Everyone Gets TPed that's in XYZ to XYZ?

ELEM3NT

LUA Status: Beginner
Joined
Mar 12, 2009
Messages
191
Reaction score
0
Location
In your room without you knowing.
Okay, uh well I have an event called "Maze Event" and you have to run around looking like a rat looking for the cheese.

Script 1)The first person to right click the cheese wins! But the only thing is that I need it so when he wins, everyone in the event gets tped back to the temple or any another position. So like right click cheese>everyone gets tped to temple. My working script atm, just need the tp thing:

mazecheese.lua
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
ppos = getPlayerPosition(cid)
temple = getPlayerMasterPos(cid)
	if item.itemid == 2696 then
	doBroadcastMessage(getPlayerName(cid) .. " has won the maze event! Congratulations! Please leave the event now, tp is where you started. Stay tune for the next manual event! ", 22)
	doPlayerAddItem(cid, 9020, 10)
	doRemoveItem(cid, item.uid, 1)
	doTeleportThing(cid, temple, TRUE)
	doSendMagicEffect(temple,66)
	end
end
Don't mind my tabbing lol..

2) How do I make it so everyone is the same speed in the area? Like from xyz to xyz everyones the same speed so people won't overpower someone else, or is it like a certain tile that makes them slow? :O?

If you can make any of these scripts, please do so!

ThanksAndBYE:peace:
 
I don't have time to script right now but you can change the speed of the player when he enters the event. I guess he enters by walking, then you have to make a movement script with the function OnStepIn, when he steps in the tile then you add the function to change the speed of the player, and to remove their speed and leave it as defalt make it same way when exiting by walking and removing the speed.
 
1)
Code:
local b = {x=100, y=100, z=7} --- top left corner of the maze
local e = {x=200, y=200, z=7} --- bottom right corner of the maze
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doBroadcastMessage(getPlayerName(cid) .. " has won the maze event! Congratulations! Please leave the event now, tp is where you started. Stay tuned for the next manual event! ", 22)
	doPlayerAddItem(cid, 9020, 10)
	doRemoveItem(item.uid, 1)
	for x = b.x, e.x do
		for y = b.y, e.y do
			for z = b.z, e.z do
				local v = getTopCreature({x=x, y=y, z=z}).uid
				if isPlayer(v) then
					local temple = getPlayerMasterPos(v)
					doTeleportThing(v, temple)
					doSendMagicEffect(temple,66)
				end
			end
		end
	end
end
 
LUA:
local poses = { 
				{x=4,y=5,z=4}, --Top Left Pos.
				{x=7,y=7,z=7}, -- Bottom Right Pos.
				{x=5,y=6,z=8}; -- Where Tp Players After Event
			};
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 2696 then
		doBroadcastMessage(getPlayerName(cid) .. " has won the maze event! Congratulations! Stay tune for the next manual event! ", 22);
		doPlayerAddItem(cid, 9020, 10);
		doRemoveItem(cid, item.uid, 1);

		for ax = poses[1].x, poses[2].x do
			for ay = poses[1].y, poses[2].y do
				for az = poses[1].z, poses[2].z do
					creature = getTopCreature({x=ax,y=ay, z=az, stackpos=253}).uid;
					if isPlayer(creature) then
						doTeleportThing(creature, poses[3]);
					end
				end
			end
		end
	end
	return true;
end

Edit: EFJSOGWERJFWERIOER Cykotitan. Always First ya? xD
 
Back
Top