I'm trying to make a door that opens at a certain time but my code won't work. I've gotten it to work a couple of times but it'll just open once and close once and not loop. Any help is appreciated.
minutesAfterMidnight = 0
while true do
minutesAfterMidnight = minutesAfterMidnight + 60
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(.1)
end
while true do
if minutesAfterMidnight == 360 then
script.Parent.Transparency = 1
script.Parent.CanCollide = false
elseif minutesAfterMidnight == 720 then
script.Parent.Transparency = 0
script.Parent.CanCollide = true
wait(.1)
end
end

1 comment
Thank you so much!