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

How to get the Source of a MouseClick?

Asked by 4 years ago

If I had a function activate onClick with a click detector in a global script, is there a way to know who clicked on the part? (either player or character)

1 answer

Log in to vote
1
Answered by 4 years ago

The first parameter of the MouseClick event is the player who clicked it, so you could do:

clickDetector.MouseClick:Connect(function(plr)
    ...
end)
Ad

Answer this question