I am making a game called "Memory Madness" in which players must repeat a sequence of colors to survive, those who do not put in the correct sequence are eliminated. I am up to the intermission part and where players are teleported into the map. After I randomize the teams, I want to make sure that the person on the Green team gets teleported to the green spot, and that the Red team gets teleported to the red stop and so on. How would I achieve this?
✓ ANSWER ACCEPTED
How do I make a player be teleported to a certain place based on their team?
1 answer
✓ Accepted answer
Assuming you don't want to do SpawnLocations, it'd work like this.
Players = game:GetService('Players')
for _,player in pairs(Players:GetPlayer()) do
if player.Team = game.Teams['TEAMNAMEHERE'] then
player.Character.HumanoidRootPart.CFrame = Vector3.new(0,0,0) -- Replace with whatever vector you want.
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
^ You can also use math to make sure people do not teleport into each other.
Wouldn't matter. If you make collision groups between players not colliding then they won't touch, which all good games should do and have to prevent flinging.
By the way, it should be :GetPlayers() instead.
And not all "good" games necessarily require players not colliding. Games have their reasons to go either way.
Ah yes, I made a spelling error. My bad. But yes, it should GetPlayers() and supposedly Collision Group is the way to go.