Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make a player teleport when they click on your gui?

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

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)

3 comments

0

FYI, you can also do "player.Character:MoveTo(position)" instead of "player.Character.Torso.CFrame = CFrame.new(position)"

0

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

0

If it's just me or.. this doesn't work.

This discussion is preserved as it was. New answers, comments, and votes are closed.