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

Teleporting 10 Players to 10 Parts?

I'm building a game where it picks a map, places it in workspace, and then teleports players to that map. I already have it down, but my problem is I want it to send 10 players to 10 different parts that are close to each other. Kind of what you see in Laser Tag Arena or in The Mad Murderer where it spreads the players apart. I want the 1st part of the script to look like this,

for i, player in pairs (game.Players:GetChildren()) do
-- code for teleporting 10 players goes here
end

Can anyone help me? Do I just send the players to 10 different parts that have the same name or something?

1 answer

✓ Accepted answer
parts = {}

for _,v in pairs(map:GetChildren()) do							-- tele pads from map
	if v:IsA("BasePart") and v.Name == "TeleportPad" then
		table.insert(parts,v)
	end
end


for i,player in pairs(game.Players:GetChildren()) do
	player.Character:MoverTo( parts[I].Position )
end


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