Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

button door script not working?

Asked by 11 years ago
01door=script.Parent.Parent.trapdoor
02function onCicked()
03door.Transparency=0.6
04door.CanCollide=false
05wait(2)
06door.Transparency=0
07door.CanCollide=true
08 
09end
10script.Parent.ClickDetector.MouseClick:connect(onClicked) --this my script, i do not know why it does not work
01door = 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
08end
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

1 answer

Log in to vote
0
Answered by 11 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 — 11y
0
well i figured out the problem, i spelled click wrong, i put cick namelessassasin 30 — 11y
Ad

Answer this question