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
8 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 8 years ago

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.

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

Answer this question