Hello! Okay so, I am a begginer at scripting. So now I know a Little I wanted to practise and experiment. But none of my scripts I write work!! Here is one I wrote and it does not work:
script.Parent.ClickDetector:connect(function() script.Parent.BrickColor = BrickColor.new ("Pink") end)
Yes, I have a click detector in the block. And on Youtube PeasFactory uses this and it works, but not for me. There is nothing in the output either :/ Please help me.
Use MouseClick. It is an event of the ClickDetector that fires when you click on it. Connect it to the function and it will work.
script.Parent.ClickDetector.MouseClick:Connect(function(player) script.Parent.BrickColor = BrickColor.new("Pink") end)
Also, use Connect, as connect is deprecated. Not that it was the reason your script didn't work, because it wasn't but it is better to use non-deprecated functions.