Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Teleporting Player to Player?

Asked by
99names 10
8 years ago

How can I teleport a player to another player and selecting the player to be teleported to by using a textbox?

2 answers

Log in to vote
1
Answered by
Vezious 310 Moderation Voter
8 years ago

Use LostFocus For the event. As this activates when the player has left the text box. use game.Workspace:FindFirstChild(TextBox Text) and game.LocalPlayer.Character.Torso.CFrame = Chosen Player Torso CFrame

Ad
Log in to vote
-1
Answered by 8 years ago

I recommend you use the FocusLostevent in a local script, The FocusLostevent fires every time the TextBox loses focus (by the enter button being pressed). Make sure the event searches in the Players service for the player with the name of the text in the TextBoxand sets the CFrame of the your character's torso to the player with their name in the TextBox.

Player1.Character.Torso.CFrame = Player2.Character.Torso.CFrame * CFrame.new(0, 5, 0)

Answer this question