local click = script.Parent.ClickDetector
function onClick()
script.Parent.BrickColor = BrickColor.random()
end
click.MouseClick:connect(onClick)
and i put it in under click detecter, as the click detecter is the parent of this script. and the parent of that click detecter is a block. what did i do wrong?

2 comments
i did this and it didnt work. do i put the script under the click detecter as the click detecter was the parent. and a block was the parent of the click detecter
oh gg it works