I have a click detector in my model and a script, when i click on the model it should print somthing but it does not print anything(there are no Errors or Warnings) , and it is because the model is local (only specific player can see it). Can anyone tell me how to solve the problem?
script code :
local clickDetector = script.Parent.ClickDetector
function onMouseClick(player)
print(player.Name," clicked me!")
end
clickDetector.MouseClick:Connect(onMouseClick)

1 comment
If you need a LocalScript to run code when the Model is clicked, the LocalScript can't be inside the model. It has to be in one of the places where LocalScripts can execute from (PlayerScripts, PlayerGui, etc.) and getting a reference to the Model and ClickDetector via a WaitForChild() call.