Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I teleport players? i.e rounds, intermission, lobby, map

I have tried every which way and watched every tutorial known to man. What I would like to do is make it so that people spawn in the lobby, then, I would like it so that there is a 30 sec intermission, followed by a teleportation to a random map. Then, after 2 minutes, the round ends and everyone is teleported back to the lobby. I have tried the tutorial by AlvinBlox ( https://www.youtube.com/watch?v=z9EgTqThDmU&t=1230s) , which didn't work. And no useful tutorials either. If you could help me, or at least point me in the right direction, that'd be awesome

2 answers

I actually made something like this a while ago. I believe I also posted for help on here.

What I did was make an Empty Array for the lobby. For mine I wanted to have it so the player can choose to participate in a round or not. Therefore I set up a button. When clicked they are added to the array. However if you want to automatically add people to the lobby when they join. You can bind something to the player connect and add them to the array.

Afterwards found a timer system that counts down. I made variable states.. or a game state. People register for a round. If there is a certain amount of players in the array then I start the round start timer. When the timer is done I teleport everyone to the game level and remove them from the lobby Array. I then place them in the INROUND array. so that I still have access to them while they are playing the game. After the round is over.. Everyone has to sign up for the game again. Then an intermission timer starts. After the intermission counts down the round starts and everything repeats.

You teleport people by I believe teleporting the torso.. You can do that VIA CFrame. Someone else may have more detailed information.. I'm just giving you a broad over view to answer your question. With enough effort you can build your system from this answer alone.

You can generate a map by using the ReplicatedStorage.. just clone it to the Workspace when you are ready to use it. Other items work the same way.

You can see a demo of it all in action here. If you have any more questions let me know.

--[[ INSTRUCTIONS: Place both teleporter1a and teleporter1b in the same directory (e.g. both in workspace directly, or both directly in the same group or model) Otherwise it wont work. Once youve done that, jump on the teleporter to teleport to the other. If you want more than one set of teleporters I will be adding more types in the future.

Send me requests and ideas - MrZombieMarine. --]

--Enter the name of the model you want to go to here.

modelname="tele2"

function onTouched(part) if part.Parent = nil then local h = part.Parent:findFirstChild("Humanoid") if h=nil then local teleportfrom=script.Parent.Enabled.Value if teleportfrom~=0 then if h==humanoid then return end local teleportto=script.Parent.Parent:findFirstChild(modelname) if teleportto~=nil then local torso = h.Parent.Torso local location = {teleportto.Position} local i = 1

				local x = location[i].x
				local y = location[i].y
				local z = location[i].z
			
				x = x + math.random(-1, 1)
				z = z + math.random(-1, 1)
				y = y + math.random(2, 3)

				local cf = torso.CFrame
				local lx = 0
				local ly = y
				local lz = 0
				
				script.Parent.Enabled.Value=0
				teleportto.Enabled.Value=0
				torso.CFrame = CFrame.new(Vector3.new(x,y,z), Vector3.new(lx,ly,lz))
				wait(3)
				script.Parent.Enabled.Value=1
				teleportto.Enabled.Value=1
			else
				print("Could not find teleporter!")
			end
		end
	end
end

end

script.Parent.Touched:connect(onTouched)

This discussion is preserved as it was. New answers, comments, and votes are closed.