Day and night script

How do I make this script so that night time lasts way shorter than day time?

local Game = game
local Lighting = Game:GetService("Lighting")
local RunService = Game:GetService("RunService")

local MinutesPerSecond = 1 --1 second equivalent to 1 minute (1 day = 24 minutes).

local function OnHeartbeat(Delta)
	Lighting.ClockTime += (MinutesPerSecond / 60) * Delta
end

RunService.Heartbeat:Connect(OnHeartbeat)
1 Like

Just make a while loop with two for loops: one for daytime and one for nighttime, and make the daytime for loop last longer. If you don’t care much about smoothness you could also just do this in a while loop:

while true do
Lighting.ClockTime = 12
task.wait(1000) -- change to however long you want daytime to last
Lighting.ClockTTime = 19
task.wait(500) -- change to however long you want nighttime to last
end
1 Like
local Game = game
local Lighting = Game:GetService("Lighting")
local RunService = Game:GetService("RunService")

local MinutesPerSecond = 100 --1 second equivalent to 1 minute (1 day = 24 minutes).

local defaultTime = 60
local dayTime = 15

local function OnHeartbeat(Delta)
	if Lighting.ClockTime < 17.5 then
	Lighting.ClockTime += (MinutesPerSecond / defaultTime) * Delta
		print("Hey")
	else
		Lighting.ClockTime += (MinutesPerSecond / dayTime) * Delta
		print("Yo")
	end
end

RunService.Heartbeat:Connect(OnHeartbeat)

Doesn’t work the best, but it shortens the night.