4zx16

Day & Night

Oct 24th, 2021 (edited)
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.13 KB | None | 0 0
  1. --[[
  2.  || 📜 AUTHOR: @4zx16 || DAY/NIGHT CYCLE || DON'T TOUCH UNLESS U KNOW WHAT UR DOING
  3. ]]
  4. local L = game:GetService("Lighting")
  5. local t = L:GetMinutesAfterMidnight()
  6.  
  7. while true do
  8.     wait(1)
  9.     L:SetMinutesAfterMidnight(t + 1)
  10.     if t < 300 then -- Night time, after midnight.
  11.         L.OutdoorAmbient = Color3.new(30/255,30/255,30/255)
  12.     elseif t > 300 and t < 390 then -- Dawn, sun rise.
  13.         L.OutdoorAmbient = Color3.new((30+(t-300)/1.5)/255,(30+(t-300)/1.5)/255,(30+(t-300)/1.5)/255)
  14.     elseif t > 390 and t < 600 then -- Morning.
  15.         L.OutdoorAmbient = Color3.new((90+(t-390)/7)/255,(90+(t-390)/7)/255,(90+(t-390)/7)/255)
  16.     elseif t > 600 and t < 840 then -- Day time.
  17.         L.OutdoorAmbient = Color3.new(120/255,120/255,120/255)
  18.     elseif t > 840 and t < 1050 then -- Afternoon.
  19.         L.OutdoorAmbient = Color3.new((120-(t-840)/7)/255,(120-(t-840)/7)/255,(120-(t-840)/7)/255)
  20.     elseif t > 1050 and t < 1140 then -- Evening, sun set.
  21.         L.OutdoorAmbient = Color3.new((90-(t-1050)/1.5)/255,(90-(t-1050)/1.5)/255,(90-(t-1050)/1.5)/255)
  22.     elseif t > 1140 then -- Night time, before midnight.
  23.         L.OutdoorAmbient = Color3.new(30/255,30/255,30/255)
  24.     end
  25. end
Add Comment
Please, Sign In to add comment