Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How do I teleport a player when they click on a GUI?

Asked by 6 years ago

How do you make it so if you click, it teleports two players in 2 seperate positions?

2 answers

Log in to vote
1
Answered by 6 years ago

I'm adding to the above answer, you can achieve the same by CFraming the Torso as-well as using MoveTo. Example:

game.Workspace.Owenrules12.Torso.CFrame = game.Workspace.Part.CFrame
OR
game.Workspace.Owenrules12.Torso.CFrame = CFrame.new(5,5,5) -- X,Y,Z
Ad
Log in to vote
0
Answered by
Everesty 1016 Moderation Voter
6 years ago

You can use the MouseButton1Click event on a TextButton.

YourTextButton.MouseButton1Click:connect(function()
    -- Teleport the player
end)

Then you can teleport the player(s)!

YourPlayer1.Character:MoveTo(Position1)
YourPlayer2.Character:MoveTo(Position2)

Answer this question