local R=16 local U=R*60 local m=1440 local A=game:GetService("\076\105\103\104\116\105\110\103")local H=tick()-(A:getMinutesAfterMidnight()/m)*U local P=H+U local J=m/U if R==0 then R=1 end repeat local R=tick()if R>P then H=P P=H+U end A:setMinutesAfterMidnight((R-H)*J)wait(.066666666666667)until false

local dayLength = 16

local cycleTime = dayLength*60
local minutesInADay = 24*60

local lighting = game:GetService("Lighting")

local startTime = tick() - (lighting:getMinutesAfterMidnight() / minutesInADay)*cycleTime
local endTime = startTime + cycleTime

local timeRatio = minutesInADay / cycleTime

if dayLength == 0 then
	dayLength = 1
end

repeat
	local currentTime = tick()
	
	if currentTime > endTime then
		startTime = endTime
		endTime = startTime + cycleTime
	end
	
	lighting:setMinutesAfterMidnight((currentTime - startTime)*timeRatio)
	wait(1/15)
until false
