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)
The first parameter of the MouseClick event is the player who clicked it, so you could do:
clickDetector.MouseClick:Connect(function(plr) ... end)