I'm trying to make my player teleport (To another place) when they click the gui i'm completely confused on what to do so i have no code snippets. i know how to teleport them to a new place but not how to do it when they click the gui
✓ ANSWER ACCEPTED
How to make a player teleport when they click on your gui?
2 answers
✓ Accepted answer
This isnt a forums for people making you scripts, this is intended for people to help you with your scirpts. Atleast give it a shot. If you really want to be lazy, then heres the source code to do it:
script.Parent.MouseButton1Click:connect(function(player)
--code to teleport them
end)
If you are actually extremely lazy then 1) laziness will get you no where. 2) here you go:
local position = positionthatyouwantplayerstoteleporto
script.Parent.MouseButton1Click:connect(function(player)
player.Character.Torso.CFrame = CFrame.new(position)
print'player teleported'
end)
Use the wiki my friend :) http://wiki.roblox.com/index.php?title=API:Class/GuiButton/MouseButton1Click
2 comments
0
this did not work D:
0
Script?
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
FYI, you can also do "player.Character:MoveTo(position)" instead of "player.Character.Torso.CFrame = CFrame.new(position)"
i'm not lazy its just i'm usually good at scripting but i was totally confused sorry about that second of all how do you even put the script on there idk how
If it's just me or.. this doesn't work.