local D={0;0,0;0;0;255,255,255,255,255,255,255;255,255,255,255;255;255;255;0,0;0,0;0}local n={165;165,165;165;165,210;215,230;255,255;255,255;255,255;255;245,230,215,255;165;165,165,165,165}local b={255,255,255,255;255;100,110,135;255;255,255,255;255;255;255,215,135,110;255,255;255;255,255;255}local M local m local i while true do mam=game.Lighting:GetMinutesAfterMidnight()+timeShift game.Lighting:SetMinutesAfterMidnight(mam)mam=mam/60 game.Lighting.Brightness=amplitudeB*math.cos(mam*(pi/12)+pi)+offsetB var=amplitudeO*math.cos(mam*(pi/12)+pi)+offsetO game.Lighting.OutdoorAmbient=Color3.fromRGB(var,var,var)game.Lighting.ShadowSoftness=amplitudeS*math.cos(mam*(pi/6))+offsetS pointer=math.clamp(math.ceil(mam),1,24)M=(D[pointer%24+1]-D[pointer])*((mam-pointer)+1)+D[pointer]m=(n[pointer%24+1]-n[pointer])*((mam-pointer)+1)+n[pointer]i=(b[pointer%24+1]-b[pointer])*((mam-pointer)+1)+b[pointer]game.Lighting.ColorShift_Top=Color3.fromRGB(M,m,i)wait(waitTime)end

local rColorList = {000,000,000,000,000,255,255,255,255,255,255,255,255,255,255,255,255,255,255,000,000,000,000,000}
local gColorList = {165,165,165,165,165,210,215,230,255,255,255,255,255,255,255,245,230,215,255,165,165,165,165,165}
local bColorList = {255,255,255,255,255,100,110,135,255,255,255,255,255,255,255,215,135,110,255,255,255,255,255,255}
local r
local g
local b

while true do
	--time changer
	mam = game.Lighting:GetMinutesAfterMidnight() + timeShift
	game.Lighting:SetMinutesAfterMidnight(mam)
	mam = mam/60
	
	--brightness
	game.Lighting.Brightness = amplitudeB*math.cos(mam*(pi/12)+pi)+offsetB
	
	--outdoor ambient
	var=amplitudeO*math.cos(mam*(pi/12)+pi)+offsetO
	game.Lighting.OutdoorAmbient = Color3.fromRGB(var,var,var)
	
	--shadow softness
	game.Lighting.ShadowSoftness = amplitudeS*math.cos(mam*(pi/6))+offsetS
	
	--color shift top
	pointer= math.clamp(math.ceil(mam), 1, 24)
	r=((rColorList[pointer%24+1]-rColorList[pointer])*(mam-pointer+1))+rColorList[pointer]
	g=((gColorList[pointer%24+1]-gColorList[pointer])*(mam-pointer+1))+gColorList[pointer]
	b=((bColorList[pointer%24+1]-bColorList[pointer])*(mam-pointer+1))+bColorList[pointer]
	game.Lighting.ColorShift_Top=Color3.fromRGB(r,g,b)
	
	--tick
	wait(waitTime)
end
