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

How do i make a surface gui the teleports player to another place when clicked?

Here is what i have so far

--!
local x = script.Parent
x.Parent = game.StarterGui
x.Adornee = game.Workspace.TpButton.Parts



function onclicked()
game:GetService('TeleportService'):Teleport(147513144, game.Workspace.LocalPlayer)
end

x.TeleportButton.MouseButton1Down:connect(onclicked)

3 answers

✓ Accepted answer

This isn't really possible, how you're doing it. The MouseButton1Down event does not give the argument of who click on the button. Instead run the connection on the client, that should make it so when the client clicks the button it runs on their client, meaning you know who clicked the button.

1 comment

0

It is possible if you parent the SurfaceGui to the PlayerGui.

That should work in a LocalScript, remember to fix this:

game.Players.LocalPlayer.Character

1 comment

0

I have the same problem as reteach and none of this works

Still not working

1 comment

0

The answers section is ONLY for answering the question. Do not reply to others using the answer section; use the comments system.

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