Advertisement
Drvays

Day and Night Cycle

Apr 27th, 2023
21,199
1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 1 0
  1. --[[ Made by coolcapidog
  2. Channel ->> https://www.youtube.com/c/coolcapidog
  3. You can change the settings but you shouldn't change anything except settings.
  4. ]]
  5. ------------- Settings
  6. local Speed = 60 -- Second
  7. local DayDuration = 1 -- Minute
  8. local NightDuration = 1 -- Minute
  9. ------------- Settings
  10.  
  11. local Lighting = game.Lighting
  12. local TweenService = game:GetService("TweenService")
  13.  
  14. function day()
  15. TweenService:Create(Lighting, TweenInfo.new(Speed), {ClockTime = 12}):Play()
  16. TweenService:Create(Lighting, TweenInfo.new(Speed), {Brightness = 3.05}):Play()
  17. TweenService:Create(Lighting, TweenInfo.new(Speed), {Ambient = Color3.fromRGB(106, 130, 186)}):Play()
  18. TweenService:Create(Lighting, TweenInfo.new(Speed), {ColorShift_Bottom = Color3.fromRGB(0,0,0)}):Play()
  19. end
  20.  
  21. function night()
  22. TweenService:Create(Lighting, TweenInfo.new(Speed), {ClockTime = 0}):Play()
  23. TweenService:Create(Lighting, TweenInfo.new(Speed), {Brightness = 0.4}):Play()
  24. TweenService:Create(Lighting, TweenInfo.new(Speed), {Ambient = Color3.fromRGB(0,0,0)}):Play()
  25. TweenService:Create(Lighting, TweenInfo.new(Speed), {ColorShift_Bottom = Color3.fromRGB(0,0,0)}):Play()
  26. end
  27.  
  28. while true do
  29. day()
  30. wait(DayDuration60)
  31. night()
  32. wait(NightDuration60)
  33. end
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement