Ad
Log in to vote
0

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

Asked by 7 years ago

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

Log in to vote
0
Answered by
Everesty 1001 Moderation Voter
7 years ago

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.

0
It is possible if you parent the SurfaceGui to the PlayerGui. RaverKiller 668 — 7y
Ad
Log in to vote
0
Answered by 7 years ago

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

game.Players.LocalPlayer.Character
0
I have the same problem as reteach and none of this works Alanisme124 0 — 3y
Log in to vote
-2
Answered by 7 years ago

Still not working

0
The answers section is ONLY for answering the question. Do not reply to others using the answer section; use the comments system. Everesty 1001 — 7y

Answer this question