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

how to find the player?

Asked by
Benqazx 108
9 years ago

if there is an clickdectator in a brick and someone clicks that brick how would you find the person who clicked it.

1 answer

Log in to vote
3
Answered by 9 years ago

this is considering the script is inside the clickdetector, inside the part

1scritpt.Parent.MouseClick:connect(function(playerWhoClicked)
2    print(playerWhoClicked.Name)
3end)

the param for mouseClick is the player who clicked.

1
i did that but i added a playerwhoclicked.Parent so thats why it wasnt working Benqazx 108 — 9y
0
Why did you add parent? ScriptsAhoy 202 — 9y
1
no 0xDEADC0DE 310 — 9y
0
i thought it was same as the touch function Benqazx 108 — 9y
View all comments (2 more)
0
so it would return what? the players torso? the Right leg? Hinest mistake though ScriptsAhoy 202 — 9y
0
Scritpts can be tricky User#11440 120 — 9y
Ad

Answer this question