if there is an clickdectator in a brick and someone clicks that brick how would you find the person who clicked it.
✓ ANSWER ACCEPTED
how to find the player?
1 answer
✓ Accepted answer
this is considering the script is inside the clickdetector, inside the part
scritpt.Parent.MouseClick:connect(function(playerWhoClicked)
print(playerWhoClicked.Name)
end)
the param for mouseClick is the player who clicked.
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
i did that but i added a playerwhoclicked.Parent so thats why it wasnt working
Why did you add parent?
no
i thought it was same as the touch function
so it would return what? the players torso? the Right leg? Hinest mistake though
Scritpts can be tricky