b=script.Parent local U,F=6,20 local i,A=17,45 local y=game:service("\076\105\103\104\116\105\110\103")if F==nil then F=0 end if A==nil then A=0 end function TimeChanged()local d=(U+F/60)*60 local r=(i+A/60)*60 if d<r then if y:GetMinutesAfterMidnight()>=d and y:GetMinutesAfterMidnight()<=r then b.Enabled=false else b.Enabled=true end elseif d>r then if y:GetMinutesAfterMidnight()>=d or y:GetMinutesAfterMidnight()<=r then b.Enabled=false else b.Enabled=true end end end TimeChanged()game.Lighting.Changed:connect(function(U)if U=="\084\105\109\101\079\102\068\097\121"then TimeChanged()end end)


b = script.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
		else
b.Enabled = true
		end
	elseif (ot > ct) then
		if (l:GetMinutesAfterMidnight() >= ot) or (l:GetMinutesAfterMidnight() <= ct) then
b.Enabled = false
		else
b.Enabled = true
		end
	end
end

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