When i do print(Looping) its printing 1 and doesn't augment every time it does loop
wait(2) game.Lighting.Ambient = Color3.fromRGB(109 , 109, 109) game.Lighting.OutdoorAmbient = Color3.fromRGB(117, 117, 117) local Looping = 0 local OR = tonumber(game.Lighting.OutdoorAmbient.r * 255) local AR = tonumber(game.Lighting.Ambient.r * 255) game.Lighting.Changed:Connect(function() if game.Lighting.TimeOfDay == "17:30:00" then repeat wait(1) AR = AR - 0.33333333333333 game.Lighting.Ambient = Color3.fromRGB(AR , AR, AR) Looping = Looping + 1 until Looping == 29 game.Lighting.Ambient = Color3.fromRGB(99 , 99, 99) OR = tonumber(game.Lighting.OutdoorAmbient.r * 255) AR = tonumber(game.Lighting.Ambient.r * 255) elseif game.Lighting.TimeOfDay == "18:00:00" then repeat wait(1) AR = AR - 1.3666666666666666666666666666667 OR = OR - 1.7 game.Lighting.Ambient = Color3.fromRGB(AR , AR, AR) game.Lighting.OutdoorAmbient = Color3.fromRGB(OR , OR, OR) Looping = Looping + 1 until Looping == 29 game.Lighting.Ambient = Color3.fromRGB(58, 58, 58) game.Lighting.OutdoorAmbient = Color3.fromRGB(66, 66, 66) OR = tonumber(game.Lighting.OutdoorAmbient.r * 255) AR = tonumber(game.Lighting.Ambient.r * 255) elseif game.Lighting.TimeOfDay == "18:30:00" then repeat wait(1) OR = OR - 1.333333333333333333333333333 AR = AR - 1.333333333333333333333333333 game.Lighting.Ambient = Color3.fromRGB(AR , AR, AR) game.Lighting.OutdoorAmbient = Color3.fromRGB(OR , OR, OR) Looping = Looping + 1 until Looping == 29 game.Lighting.Ambient = Color3.fromRGB(18 , 18, 18) game.Lighting.OutdoorAmbient = Color3.fromRGB(26, 26, 26) OR = tonumber(game.Lighting.OutdoorAmbient.r * 255) AR = tonumber(game.Lighting.Ambient.r * 255) print("Bruh!") elseif game.Lighting.TimeOfDay == "19:00:00" then repeat wait(1) AR = AR - 0.6 OR = OR - 0.9 game.Lighting.Ambient = Color3.fromRGB(AR , AR, AR) game.Lighting.OutdoorAmbient = Color3.fromRGB(OR , OR, OR) Looping = Looping + 1 until Looping == 29 game.Lighting.Ambient = Color3.fromRGB(0 , 0, 0) game.Lighting.OutdoorAmbient = Color3.fromRGB(0, 0, 0) elseif game.Lighting.TimeOfDay == "05:00:00" then repeat wait(1) AR = AR + 1.6666666666666666666666666666667 OR = OR + 1.7833333333333333333333333333333 game.Lighting.Ambient = Color3.fromRGB(AR , AR, AR) game.Lighting.OutdoorAmbient = Color3.fromRGB(OR , OR, OR) Looping = Looping + 1 until Looping == 29 game.Lighting.Ambient = Color3.fromRGB(50 , 50, 50) game.Lighting.OutdoorAmbient = Color3.fromRGB(53.5, 53.5, 53.5) elseif game.Lighting.TimeOfDay == "05:30:00" then repeat wait(1) AR = AR + 1 OR = OR + 1.45 game.Lighting.Ambient = Color3.fromRGB(AR , AR, AR) game.Lighting.OutdoorAmbient = Color3.fromRGB(OR , OR, OR) Looping = Looping + 1 until Looping == 29 game.Lighting.Ambient = Color3.fromRGB(80 , 80, 80) game.Lighting.OutdoorAmbient = Color3.fromRGB(97, 97, 97) elseif game.Lighting.TimeOfDay == "06:00:00" then repeat wait(1) AR = AR + 0.96666666666666666666666666666667 OR = OR + 0, 66666666666666666666666666666667 game.Lighting.Ambient = Color3.fromRGB(AR , AR, AR) game.Lighting.OutdoorAmbient = Color3.fromRGB(OR , OR, OR) Looping = Looping + 1 until Looping == 29 game.Lighting.Ambient = Color3.fromRGB(109 , 109, 109) game.Lighting.OutdoorAmbient = Color3.fromRGB(117, 117, 117) end Looping = 0 end)
Instead of in between repeat and until I would try deleting that and making the next like wait(5 or a number) and the part you want to loop in a
while true do end
while true do means loop which loops the script forever
or if that don't work try using the same script just the part you want to loop place the while true do script and place an end at the end of the script.