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

Help location player?

Asked by 8 years ago

How can I locate the player who clicked a gui button?

1 answer

Log in to vote
1
Answered by 8 years ago

If you are using a local script, you can find the player by using

Game.Players.LocalPlayer

However, if you are using a regular script (I'm not sure why you would want to do this for things local to the client) then you will have to use another method such as script.Parent.Parent providing that the script is inside the GUI, and the GUI is inside the Players PlayerGui

Ad

Answer this question