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

How do I get the name of the player who clicked a ClickDetector?

Asked by
Axenori 124
5 years ago

How do I get the name of a player who activated a ClickDetector? (in this context by player I mean the name of their character model in Workspace)

1 answer

Log in to vote
0
Answered by 5 years ago

whenever the ClickDetector.MouseClick() event fires, it passes the player object of the player that clicked it..

so all you have to do is:

1clickDetector.MouseClick:Connect(function(player)
2    print(player.Name, " clicked the button")
3end)
0
I agree! Soban06 410 — 5y
Ad

Answer this question