I'm trying to make an animated door (not one that teleport open) but need help as I am really inexperienced with code and practically new to coding.
Code:
function OnClick()
script.Parent.Transparency = 1
script.Parent.CanCollide = false
script.Parent.Parent.OPEN1.Transparency = 0
script.Parent.Parent.OPEN1.CanCollide = true
wait(1.5)
script.Parent.Parent.OPEN1.Transparency = 1
script.Parent.Parent.OPEN1.CanCollide = false
script.Parent.Parent.OPEN2.Transparency = 0
script.Parent.Parent.OPEN2.CanCollide = true
wait(1.5)
script.Parent.Parent.OPEN2.Transparency = 1
script.Parent.Parent.OPEN2.CanCollide = false
script.Parent.Parent.OPEN3.Transparency = 0
script.Parent.Parent.OPEN3.CanCollide = true
wait(1.5)
script.Parent.Parent.OPEN3.Transparency = 1
script.Parent.Parent.OPEN3.CanCollide = false
script.Parent.Parent.OPEN4.Transparency = 0
script.Parent.Parent.OPEN4.CanCollide = true
wait(1.5)
script.Parent.Parent.OPEN4.Transparency = 1
script.Parent.Parent.OPEN4.CanCollide = false
script.Parent.Parent.OPEN5.Transparency = 0
script.Parent.Parent.OPEN5.CanCollide = true
wait(1.5)
script.Parent.Parent.OPEN5.Transparency = 1
script.Parent.Parent.OPEN5.CanCollide = false
script.Parent.Parent.OPEN6.Transparency = 0
script.Parent.Parent.OPEN6.CanCollide = true
wait(1.5)
script.Parent.Parent.OPEN6.Transparency = 1
script.Parent.Parent.OPEN6.CanCollide = false
script.Parent.Parent.OPEN7.Transparency = 0
script.Parent.Parent.OPEN7.CanCollide = true
wait(1.5)
script.Parent.Parent.OPEN7.Transparency = 1
script.Parent.Parent.OPEN7.CanCollide = false
script.Parent.Parent.OPEN8.Transparency = 0
script.Parent.Parent.OPEN8.CanCollide = true
wait(1.5)
end
script.Parent.ClickDetector.MouseClick:Connect(OnClick)
"OPEN?" These are individual parents in studio, not grouped together. There is other scripts obviously for closing the door and opening it the other way, but they're all based around this.
This code just makes the door handle disappear.
Any tips and hints on how to fix this will be appreciated! Thank you!

2 comments
This isn't the best way to tackle this. I'd rather use TweenService or use a for loop. 1.5 seconds is waaay too long if you want to make a smooth animation.
I knoooow! When I looked at how long it was I was like "This isn't going to work". Since I'm not that sure about for loops, I tried a while loop, since the answers didn't work, but at least didn't make the doornob disappear. Still didn't work- but the script was considerably cleaner, so I count it as a win