b=script.Parent c=script.Parent.Parent.Parent local R,M=6,20 local e,l=17,45 local r=game:service("\076\105\103\104\116\105\110\103")if M==nil then M=0 end if l==nil then l=0 end function TimeChanged()local Z=(R+M/60)*60 local F=(e+l/60)*60 if Z<F then if r:GetMinutesAfterMidnight()>=Z and r:GetMinutesAfterMidnight()<=F then b.Enabled=false c.RearLight1.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"else b.Enabled=true c.RearLight1.Material="\078\101\111\110"end elseif Z>F then if r:GetMinutesAfterMidnight()>=Z or r:GetMinutesAfterMidnight()<=F then b.Enabled=false c.RearLight1.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"else b.Enabled=true c.RearLight1.Material="\078\101\111\110"end end end TimeChanged()game.Lighting.Changed:connect(function(R)if R=="\084\105\109\101\079\102\068\097\121"then TimeChanged()end end)


b = script.Parent
c = script.Parent.Parent.Parent

local oh,om = 6,20	-- Open Time (hours,minutes)
local ch,cm = 17,45	-- Close Time (hours, minutes)

local l = game:service("Lighting")
if (om == nil) then om = 0 end
if (cm == nil) then cm = 0 end


function TimeChanged()
	local ot = (oh + (om/60)) * 60
	local ct = (ch + (cm/60)) * 60
	if (ot < ct) then
		if (l:GetMinutesAfterMidnight() >= ot) and (l:GetMinutesAfterMidnight() <= ct) then
b.Enabled = false
c.RearLight1.Material = "SmoothPlastic"
		else
b.Enabled = true
c.RearLight1.Material = "Neon"
		end
	elseif (ot > ct) then
		if (l:GetMinutesAfterMidnight() >= ot) or (l:GetMinutesAfterMidnight() <= ct) then
b.Enabled = false
c.RearLight1.Material = "SmoothPlastic"
		else
b.Enabled = true
c.RearLight1.Material = "Neon"
		end
	end
end

TimeChanged()
game.Lighting.Changed:connect(function(property)
			if (property == "TimeOfDay") then
				TimeChanged()
			end
		end)
