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

How to index a Player who clicked a TextButton on a SurfaceGui? [closed]

Asked by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

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?

0
Thank you both! Shawnyg 4330 — 10y

Locked by Shawnyg, M39a9am3R, and TofuBytes

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

Why was this question closed?

2 answers

Log in to vote
2
Answered by
ipiano 120
10 years ago

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."

Ad
Log in to vote
1
Answered by
Ekkoh 635 Moderation Voter
10 years ago

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.