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

Help with getting a 'player' from a SurfaceGui?

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.

1 answer

✓ Accepted answer

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.

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