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

local dayLength = 1

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
