This script teleports everyone. Is there a way to make it so it teleports one player instead?
1 | target = Vector 3. new(- 486.5 , - 16.79 , 486.5 ) |
2 | for i, v in pairs (game.Players:GetChildren()) do |
3 | v.Character.Torso.CFrame = CFrame.new(target + Vector 3. new( 0 , i * 5 , 0 )) |
Simply remove your generic for loop, and define a specific player you'd like to teleport and you should be good.
1 | --This is the player that will be teleported. |
2 | player = game.Players.TargetPlayerName |
3 | target = Vector 3. new(- 486.5 , - 16.79 , 486.5 ) |
4 |
5 | --reference the predefined player here |
6 | player.Character.Torso.CFrame = CFrame.new(target + Vector 3. new( 0 , 5 , 0 )) |
Just loop through every player and check for the player you want to teleport.
1 | for i,v in pairs (game.Players:GetPlayers()) do |
2 | if v.Name = = game.Players.NAMEOFPLAYER then --V is the elements inside the table |
3 | --do your normal teleport stuff |
4 | end |
5 |
6 | end |