It works when I go to Play Solo mode, but when I press Play, the script won't work. I know that it has no mistakes but why won't it work?
H = game.Workspace.Door function onTouch(Door) H.Transparency = 0.5 H.CanCollide = false wait(5) H.Transparency = 0 H.CanCollide = true end script.Parent.Touched:connect(onTouch)
script.Parent.Touched:connect(function(hit) local h = game.Workspace.Door h.Transparency = .5 h.CanCollide = false wait(5) h.Transparency = 0 h.CanCollide = true end
Not sure if that will help, but try it out.
If it doesn't work, comment.
That is an (onTouch) script, so when you click "Run" there's no character to touch the door. So therefore if you test it in "Solo Mode" it will work because a character is in the game touching the door.