local n=60 local R=n*60 local Y=1440 local z=game:GetService("\076\105\103\104\116\105\110\103")local d=tick()-(z:getMinutesAfterMidnight()/Y)*R local l=d+R local r=Y/R if n==0 then n=1 end repeat local n=tick()if n>l then d=l l=d+R end z:setMinutesAfterMidnight((n-d)*r)wait(.066666666666667)until false

local dayLength = 60

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
