0

# button door script not working?

door=script.Parent.Parent.trapdoor
function onCicked()
door.Transparency=0.6
door.CanCollide=false
wait(2)
door.Transparency=0
door.CanCollide=true

end
script.Parent.ClickDetector.MouseClick:connect(onClicked) --this my script, i do not know why it does not work


door = script.Parent.Parent.Door
function onClicked()
door.Transparency = 1
door.CanCollide = false
wait(2)
door.Transparency = 0.3
door.CanCollide = true
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)--this is a random scipt i found,and it works



these scripts are very much alike but i do not know why mine does not work

0
Edit: Replace door=script.Parent.Parent.trapdoor with door = game.Workspace.trapdoor