null nil true -0.5 0.5 0 0 -0.5 0.5 4 0 194 -58 63.4000015 -234 -0 0 1 -0 1 0 -1 0 0 true false 0.5 1 0.300000012 -0.5 0.5 0 0 -0.5 0.5 0 0 false 256 DayNight Switcher 0 -0.5 0.5 0 0 0 0 0 -0.5 0.5 0 0 0 0 0 0 true 1 2 2 2 64 ClickDetector true false LightingSwitcher -- -{BOOMARANG}- daymins = 840 --420 to 1020 nightmins = 0 --1080 to 1439, or 0 to 360. brick = script.Parent mesh = brick.Mesh lighting = game.Lighting MeshTable = {"http://www.roblox.com/asset/?id=24824896", "http://www.roblox.com/asset/?id=24824915"} --Day, night. function CheckLighting(l) if l:GetMinutesAfterMidnight() >= 420 and l:GetMinutesAfterMidnight() <= 1020 then print("It is "..l:GetMinutesAfterMidnight().." minutes after midnight, making it day time.") return "Day" elseif l:GetMinutesAfterMidnight() >= 1080 or l:GetMinutesAfterMidnight() <= 360 then print("It is "..l:GetMinutesAfterMidnight().." minutes after midnight, making it night time.") return "Night" end end if CheckLighting(lighting) == "Day" then mesh.TextureId = MeshTable[1] elseif CheckLighting(lighting) == "Night" then mesh.TextureId = MeshTable[2] end --------------------------------------------------------------------------------------------------------------------------------------------------------------------- function SwitchLighting() if CheckLighting(lighting) == "Day" and mesh.TextureId == MeshTable[1] then lighting:SetMinutesAfterMidnight(nightmins) mesh.TextureId = MeshTable[2] print("Lighting changed to Night. It is now "..lighting:GetMinutesAfterMidnight().." minutes after midnight!") elseif CheckLighting(lighting) == "Night" and mesh.TextureId == MeshTable[2] then lighting:SetMinutesAfterMidnight(daymins) mesh.TextureId = MeshTable[1] print("Lighting changed to Day. It is now "..lighting:GetMinutesAfterMidnight().." minutes after midnight!") end end brick.ClickDetector.MouseClick:connect(SwitchLighting) --I love the Eggs of Equinox. true