x = game.workspace.Part
function onClicked(z)
x.Transparency = 1
x.CanCollide = false
x.BrickColor = BrickColor.new("Really green")
wait (5)
x.Transparency = 0
x.CanCollide = true
x.BrickColor = BrickColor.new("Really red")
end
game.Workspace.ClickDetector.MouseClick:connect(onClicked)
I added a clickdetector into the part as well but when I click it the Part doesnt change at all

2 comments
yeah it worked, but I dont get it. what did I do wrong in my script? only the names?
You connected the function it to the ClickDetector in the workspace rather than the one in the part.