Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- || 📜 AUTHOR: @4zx16 || DAY/NIGHT CYCLE || DON'T TOUCH UNLESS U KNOW WHAT UR DOING
- ]]
- local L = game:GetService("Lighting")
- local t = L:GetMinutesAfterMidnight()
- while true do
- wait(1)
- L:SetMinutesAfterMidnight(t + 1)
- if t < 300 then -- Night time, after midnight.
- L.OutdoorAmbient = Color3.new(30/255,30/255,30/255)
- elseif t > 300 and t < 390 then -- Dawn, sun rise.
- L.OutdoorAmbient = Color3.new((30+(t-300)/1.5)/255,(30+(t-300)/1.5)/255,(30+(t-300)/1.5)/255)
- elseif t > 390 and t < 600 then -- Morning.
- L.OutdoorAmbient = Color3.new((90+(t-390)/7)/255,(90+(t-390)/7)/255,(90+(t-390)/7)/255)
- elseif t > 600 and t < 840 then -- Day time.
- L.OutdoorAmbient = Color3.new(120/255,120/255,120/255)
- elseif t > 840 and t < 1050 then -- Afternoon.
- L.OutdoorAmbient = Color3.new((120-(t-840)/7)/255,(120-(t-840)/7)/255,(120-(t-840)/7)/255)
- elseif t > 1050 and t < 1140 then -- Evening, sun set.
- L.OutdoorAmbient = Color3.new((90-(t-1050)/1.5)/255,(90-(t-1050)/1.5)/255,(90-(t-1050)/1.5)/255)
- elseif t > 1140 then -- Night time, before midnight.
- L.OutdoorAmbient = Color3.new(30/255,30/255,30/255)
- end
- end
Add Comment
Please, Sign In to add comment