door = script.Parent.Parent.Door
function onClicked()
door.Transparency = 1
door.CanCollide = false
wait(2)
door.Transparency = 0
door.CanCollide = true
wait(3)
script.Parent.ClickDetector.MouseClick:connect(onClicked)
end
No Errors?

1 comment
On line 10 the event is being connected inside the function, when it shouldn't, unless you want to loop the function. Put it at the end of the code.