Greetings,
I am making a day/night cycle for a new game and when it sets back to daytime, it keeps going to 0.
local lighting = game.Lighting
local timer = 300
local daytime = 14
local nighttime = 21
local daysound = game.SoundService.Day
local nightsound = game.SoundService.Night
while true do
wait(timer)
daysound:Stop()
nightsound:Play()
repeat
wait(.1)
lighting.ClockTime = lighting.ClockTime + .1
until lighting.ClockTime == nighttime --sets the time to night
wait(timer)
nightsound:Stop()
daysound:Play()
repeat
wait(.1)
lighting.ClockTime = lighting.ClockTime - .1
until lighting.ClockTime == daytime --sets the time to day
end