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

How to index a Player who clicked a TextButton on a SurfaceGui?

The title is pretty self-explanatory. I've read on the Wiki that you can get the Player by placing the object in StarterGui, but when I do that, the brick itself becomes Transparent. Is there another way to find who clicked the TextButton?

1 comment

0

Thank you both!

2 answers

You put the SurfaceGui in StarterGui, not the part. They only way to do it is by having the SurfaceGui in StarterGui, and setting the Adornee property of the Gui.

As per the wiki, which may be what you were referencing: "SurfaceGuis must be descendants of PlayerGui in order to know the player who is interacting with it."

You place the SurfaceGui in StarterGui, and just make sure the Adornee property of the SurfaceGui is still set to the part. You can then find the player by moving up the hierarchy using the Parent property.

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