Creating a synced day/night cycle

So I’ve got a synced day/night cycle across roblox servers, but now I am trying to make it where daytime will last longer than nighttime and that’s where it comes to a problem and flickers

local SECONDS_IN_DAY = 30
local SECONDS_IN_NIGHT = 10
RunService.Heartbeat:Connect(function()
		local t = Time.time()
		
		local isDay = Util:IsDay(Lighting.ClockTime) -- this just checks if clocktime > 17 and < 6
		local percent
		if isDay then
			percent = t%SECONDS_IN_DAY / SECONDS_IN_DAY
		else
			percent = t%SECONDS_IN_NIGHT / SECONDS_IN_NIGHT
		end
		
		Lighting.ClockTime = percent * 24
	end)

How would you like it to vary?

If you want, you can just base it off an actual time somewhere real. If not you’ll have to give me some time to think.

1 Like

Well I’d like for it to be as customizable as possible. Basing it off a real time would be pretty limited and probably not the same effect I would like