✓ Accepted answer
You're calling the event line:
script.Parent.ClickDetector.MouseClick:connect(onClicked)
within the function, when it should actually be after the function instead.
Like this:
function onClicked(playerWhoClicked)
print("hello")
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
I'm not entirely sure what calling the event using that function, inside the function, would do aside from recursive behavior... otherwise, your code is just fine, just a little rearranging is all that is needed
PS: Also cite errors from the output if you get any, they usually help in knowing where your problem lies
2 comments
Thanks dude! Haha, I should've known :P
Glad you understand. Good day~