01 | door = script.Parent.Parent.trapdoor |
02 | function onCicked() |
03 | door.Transparency = 0.6 |
04 | door.CanCollide = false |
05 | wait( 2 ) |
06 | door.Transparency = 0 |
07 | door.CanCollide = true |
08 |
09 | end |
10 | script.Parent.ClickDetector.MouseClick:connect(onClicked) --this my script, i do not know why it does not work |
01 | door = script.Parent.Parent.Door |
02 | function onClicked() |
03 | door.Transparency = 1 |
04 | door.CanCollide = false |
05 | wait( 2 ) |
06 | door.Transparency = 0.3 |
07 | door.CanCollide = true |
08 | end |
09 |
10 | 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
Check the position of "trapdoor".
Is it in the Workspace or somewhere else?
Edit: Replace door=script.Parent.Parent.trapdoor
with door = game.Workspace.trapdoor