Advertisement
AERQ1111

ROBLOX Toggle Daytime Script (Adjustable)

Apr 4th, 2025 (edited)
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.53 KB | None | 0 0
  1. -- Upon executing, you must leave in order to disable the script
  2. local lighting = game:GetService("Lighting")
  3. local runService = game:GetService("RunService")
  4. local userInput = game:GetService("UserInputService")
  5.  
  6. local isDayMode = false
  7. local originalTime = lighting.TimeOfDay -- Stores the original game time
  8. local connection -- Holds the loop event
  9.  
  10. -- Function to enable daytime (permanent)
  11. local function enableDayMode()
  12.     connection = runService.RenderStepped:Connect(function()
  13.         lighting.TimeOfDay = "12:00:00" -- You can adjust the game time
  14.         lighting.Brightness = 2
  15.         lighting.OutdoorAmbient = Color3.fromRGB(200, 200, 200)
  16.         lighting.Ambient = Color3.fromRGB(150, 150, 150)
  17.         lighting.FogEnd = 100000
  18.     end)
  19.     print("[TOGGLE] Day Mode: ON")
  20. end
  21.  
  22. -- Function to disable day time mode and restore the original time
  23. local function disableDayMode()
  24.     if connection then connection:Disconnect() end
  25.     lighting.TimeOfDay = originalTime
  26.     print("[TOGGLE] Day Mode: OFF - Time restored to " .. originalTime)
  27. end
  28.  
  29. -- Toggle function
  30. local function toggleDayMode()
  31.     isDayMode = not isDayMode
  32.     if isDayMode then
  33.         enableDayMode()
  34.     else
  35.         disableDayMode()
  36.     end
  37. end
  38.  
  39. -- Listen for the "T" key to toggle
  40. userInput.InputBegan:Connect(function(input, gameProcessed)
  41.     if not gameProcessed and input.KeyCode == Enum.KeyCode.T then
  42.         toggleDayMode()
  43.     end
  44. end)
  45.  
  46. print("[INFO] Press 'T' to toggle Day Mode!")
  47.  
  48. -- [Time Cycle's] (that you can use to adjust the script):
  49. -- 🌅 Sunrise (Soft morning glow)
  50. -- TimeOfDay = "06:00:00"
  51. -- Brightness = 1.5
  52. -- OutdoorAmbient = Color3.fromRGB(170, 140, 100)
  53.  
  54. -- ☀️ Morning (Full daylight, bright & clear)
  55. -- TimeOfDay = "08:00:00"
  56. -- Brightness = 2.0
  57. -- OutdoorAmbient = Color3.fromRGB(200, 200, 200)
  58.  
  59. -- 🌤 Noon (Peak brightness, overhead sun)
  60. -- TimeOfDay = "12:00:00"
  61. -- Brightness = 2.2
  62. -- OutdoorAmbient = Color3.fromRGB(255, 255, 255)
  63.  
  64. -- 🌇 Afternoon (Sun slightly lower, warmer tone)
  65. -- TimeOfDay = "16:00:00"
  66. -- Brightness = 1.8
  67. -- OutdoorAmbient = Color3.fromRGB(220, 180, 140)
  68.  
  69. -- 🌆 Dusk (Golden-hour sunset)
  70. -- TimeOfDay = "18:30:00"
  71. -- Brightness = 0.9
  72. -- OutdoorAmbient = Color3.fromRGB(180, 120, 80)
  73.  
  74. -- 🌙 Night (Full night, dark blue sky)
  75. -- TimeOfDay = "20:00:00"
  76. -- Brightness = 0.3
  77. -- OutdoorAmbient = Color3.fromRGB(50, 50, 100)
  78.  
  79. -- 🌌 Midnight (Deep night, very dark)
  80. -- TimeOfDay = "00:00:00"
  81. -- Brightness = 0.2
  82. -- OutdoorAmbient = Color3.fromRGB(25, 25, 50)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement