Answered by
4 years ago Edited 4 years ago
You can teleport a character by moving the HumanoidRootPart's CFrame:
1 | Player.Character.HumanoidRootPart.CFrame = CFrame.new( 0 , 0 , 0 ) |
or if you have a part that you want to teleport a player to, you can do this:
1 | Player.Character.HumanoidRootPart.CFrame = workspace.Part.CFrame |
to teleport every player according to their team, you can just loop through every player and check what their team is:
1 | for i, player in pairs (game.Players:GetPlayers()) do |
2 | if player.Team.Name = = "Blue" then |
3 | player.Character.HumanoidRootPart.CFrame = workspace.BlueSpawn.CFrame |
4 | elseif player.Team.Name = = "Red" then |
5 | player.Character.HumanoidRootPart.CFrame = workspace.RedSpawn.CFrame |