local cd = script.Parent:WaitForChild('ClickDetector') cd.MouseClick:connect(function(playerWhoClicked) print(playerWhoClicked) end)
There is a click detector in the script parent? I've tried the remote event thing to and it doesn't work can someone help please.
EDIT: It seems as its camera based, when the camera faces the brick in a certain way it displays the "click icon"
Try this:
local cd = script.Parent:WaitForChild('ClickDetector') cd.MouseClick:connect(function() print("Clicked") end)
It should print out Clicked. If it doesn't then I don't know xd
I went into Studio and ran your code and found your problem. Your code is fine but make sure you are NOT using a local script. I tried to run the code on a local script and nothing happened but when I used a normal script it worked perfectly fine. If it still does not work then you could try removing the WaitForChild function as shown below:
local cd = script.Parent.ClickDetector script.Parent.ClickDetector.MouseClick:connect(function(playerWhoClicked) print(playerWhoClicked) end)
Hope this helps!