Hello, I am trying to attempt a day and night cycle. However, I need the times to adjust to an increase in interval. How the system works is that initially daytime will be 180 seconds but every day it will decrease by 30. Also, nighttime is initially 60 seconds but increases by 20 seconds every day. I need the day and night time to always be the same, but allow the duration of the day and night to be different.
local Duration = 180
local Inside = 30
local Diff = 60
while true do
game.Lighting.FogEnd = 750
game.Lighting.FogColor = Color3.new(0.4, 0.631373, 0.737255)
game.Lighting.ClockTime = 12
for i = Duration, 1, -1 do
updateCountdownLabel("Gather resources: " .. tostring(i))
task.wait(1)
game.Lighting.ClockTime += 0.02
end
game.Lighting.FogEnd = 500
game.Lighting.FogColor = Color3.new(0.247059, 0.396078, 0.458824)
for i = Inside, 1, -1 do
updateCountdownLabel("Get in the cabin and close the door: " .. tostring(i))
task.wait(1)
game.Lighting.ClockTime += 0.05
end
game.Lighting.FogEnd = 50
game.Lighting.FogColor = Color3.new(0, 0, 0)
for i = Diff, 1, -1 do
updateCountdownLabel("Stay in the cabin and survive: " .. tostring(i))
spawnZombie()
task.wait(1)
game.Lighting.ClockTime += 0.05
end
if Duration > 30 then
Duration -= 30
end
Diff += 20
end```