I've been wanting to know this because I want to make a teleport menu sort of like in Bulletproof Canyon II on the train system. All I need to know is how to make it so it will teleport the player who clicked the button.
✓ ANSWER ACCEPTED
How do I trigger something by clicking a button on a GUI?
1 answer
✓ Accepted answer
You would use a function to trigger when someone clicks the button. This could be made with a very small script. You would get the player (By a way of your choice), go to their Character, and use the :MoveTo() method. This is how I would do it.
--LocalScript only!!!!!
button = script.Parent --Change this to where the button is
button.MouseButton1Click:conect(function()
game.Players.LocalPlayer.Character:MoveTo(0,0,0) --Change 0,0,0 to positions.
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
I get that but I'm talking about a GUI button. This script actually is helpful though, I appreciate it!
This would work in a GUIButton. Just put it directly in the button, change the argument in the :MoveTo() method to your desired position, and it will work just the way you wish. :)
Thanks so much! I thought it would be much more confusing than this.
It would be if the Player didn't have a Character property. And NP :)
I just tried this and it doesn't seem to work. The output doesn't say there is any errors but when I test it in Play Solo it doesn't move my character. Do you know why?
Because the script won't work in Play Solo. It only works in servers.
Oh. Thanks for letting me know