local V=15 local E=V*60 local s=1440 local t=game:GetService("\076\105\103\104\116\105\110\103")local H=tick()-(t:getMinutesAfterMidnight()/s)*E local Y=H+E local h=s/E if V==0 then V=1 end repeat local V=tick()if V>Y then H=Y Y=H+E end t:setMinutesAfterMidnight((V-H)*h)wait(.066666666666667)until false

local dayLength = 15

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
