Answered by
5 years ago Edited 5 years ago
This was taken from the "DayNight" script of the "Realism Mod (V2.08)" plugin.
01 | local lighting = game:GetService( "Lighting" ) |
02 | local tweenService = game:GetService( "TweenService" ) |
05 | local nightLength = 150 |
08 | tweenService:Create(lighting, TweenInfo.new(l, Enum.EasingStyle.Linear, Enum.EasingDirection.In), p):Play() |
13 | while dayLength ~ = nil do |
15 | tween(dayLength, { ClockTime = 18 } ) |
18 | tween( 4 , { OutdoorAmbient = Color 3. new( 60 / 255 , 60 / 255 , 60 / 255 ), FogColor = Color 3. new( 25 / 255 , 25 / 255 , 25 / 255 ), FogEnd = 700 } ) |
19 | tween(nightLength / 2 , { ClockTime = 24 } ) |
21 | tween(nightLength / 2 , { ClockTime = 6 } ) |
23 | tween( 4 , { OutdoorAmbient = Color 3. new( 140 / 255 , 140 / 255 , 140 / 255 ), FogColor = Color 3. new( 195 / 255 , 195 / 255 , 195 / 255 ), FogEnd = 4500 } ) |
I edited it a bit so that a day lasted 20 minutes, so I guess here you go. It's really simple math, since 60 (seconds in a minute) multiplied by 20 (minutes) is 1200.