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

How to teleport player from lobby to map when map is chosen?

Hey,

I'm making an obby racing game where people can vote for their map to race on. Can someone explain to me what I need to do with the script to make sure that when mapselected == true the players will teleport to the stage they are racing on?

Thanks

1 comment

0

This is not a request site, but I'll post an answer anyways.

1 answer

✓ Accepted answer

So, a way to teleport a player's character is to use an in pairs loop and using the CFrame. (You shouldn't use Vector3 unless if you wanna kill the player.) Now, you can teleport any part of the body, but I suggest doing for Torso (R6) or HumanoidRootPart (R15).

local part = workspace.Part --I'm assuming you have a part...
for _, v in pairs(game.Players:GetPlayers()) do
	local char = v.Character
	char.HumanoidRootPart.CFrame = part.CFrame
end

You can include a boolean variable and just put if InRound then and other stuff, but this is the most basic answer.

2 comments

0

If i use this, the player will get teleported to the part I'm asuming?

0

Yes, you are correct.

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