Log in to vote
0

button door script not working?

Asked by 7 years ago
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

1 answer

Log in to vote
0
Answered by 7 years ago

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

0
It is in workspace, I think the problem could be that maybe I put "trapdoor" in capital in the workspace but I did not capitalize it in the script namelessassasin 30 — 7y
0
well i figured out the problem, i spelled click wrong, i put cick namelessassasin 30 — 7y
Ad

Answer this question