0

# 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

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

x.TeleportButton.MouseButton1Down:connect(onclicked)



0
Everesty 1001
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
0

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