Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Help with getting a 'player' from a SurfaceGui? [closed]

Asked by 8 years ago
local teleportblock = game.Workspace:FindFirstChild("TeleportBlock")

script.Parent.MouseButton1Down:connect(function(teleport)
    player.Character.Torso.CFrame = CFrame.new(teleportblock.Position) 
end)

I have this inside a TextButton which is inside a SurfaceGui. I know this doesn't work, but what I'm trying to figure out is how to get the player, so I can teleport them to a certain block in the game.

Locked by NinjoOnline, Shawnyg, and User#5978

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
3
Answered by 8 years ago

The only way to do this is to put the surface gui in playergui and adornee it to the part. This is good as you could use local scripts inside the surface gui.

Ad