Hi everyone! I'm just a noob scripter here trying to create a light that will turn on the green light then I can click to open the door and it auto closes, then turns on the red light. I want the door and the red light to stay locked for a time then the red light goes off and the green light will light up to indicate the door is ready to be clicked on again. So far the script below only works the first time thru, after that it's stuck on a color and wont change...can anyone help me solve this?
on = false
script.Parent.ClickDetector.MouseClick:connect(function(click)
if on == false then
on = true
script.Parent.GLight.PointLight.Enabled = true
else
end
wait(4)
on = false
script.Parent.GLight.PointLight.Enabled = false
wait(.01)
while wait do
if on == false then
on = true
script.Parent.RLight.PointLight.Enabled = true
else
end
wait(6.5)
on = false
script.Parent.RLight.PointLight.Enabled = false
wait(.01)
on = true
script.Parent.GLight.PointLight.Enabled = true
end
end)
Thank you everyone!
