I know it seems confusing, but i'm trying to make it after 180 seconds it changes back to noon, can anyone help?
local minutes = 0 local hours = 0 while true do game.Lighting.TimeOfDay = hours.."20:00:00"..minutes --what is the changed time wait(script.WaitToAdd.Value) minutes = minutes + script.AddAmount.Value if minutes >= 60 then hours = hours + 1 minutes = 0 if hours >= 24 then hours = 0 end end end --i wanted to change it back to 12:00:00.
Is this what you're trying to do?
local RunService = game:GetService("RunService") local hb = 1/60 local length = 360 -- Set this to how long, in seconds, you want the whole day to last for (from midnight back to midnight again.) while true do game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight() + ((1440/length) * hb)) hb = RunService.Heartbeat:Wait() end