So I know in a ScreenGui
it's easy to identify the Player
especially using the LocalPlayer
from the a LocalScript inside of StarterGui
but, I was wondering how you would identify a Player
under a SurfaceGui
and the SurfaceGui
is obviously under a Part
in the Workspace
.... I have tried to use player as an argument however it didn't work out... This is my failed attempt -_- I put this script inside of the TextButton
under a Frame
inside of a SurfaceGui
which is inside of the Part
.... If you help me with this I would be very greatful! Thank you :D
script.Parent.MouseButton1Down:connect(function(player) print("Hello".. player.Name "in the Club") end)
Once again thank you for reading my question and I hope you have a solution for my problem!
It's simply not feasible when the SurfaceGui is in Workspace
In order to determine the player that used a SurfaceGui, you have to put the SurfaceGui inside of the PlayerGui
and set the Adornee
property. There is no practical way to get who did it if the SurfaceGui is in Workspace, and no way to do it if you're attempting to get interaction through a Script
(Which is bad practice)