How to detect if a player clicked a click detector

How do you detect if a Player Clicked a Click Detector?
Im making a Button where if you click it, the script looks for the name of the Player that clicked it. Any Solutions?, I also looked on Youtube and searched on Dev Forums, couldnt find anything

3 Likes
1 Like

Hey, when doing something like that you want to put an argument in.

script.Parent.MouseClick:Connect(function(playerWhoClicked)
	print(playerWhoClicked)
end)
2 Likes

Thanks Im still a beginner to Scripting, and dont know all the functions to it yet.
I appreciate you help!

2 Likes