I have a simple day night cycle script and was wondering if someone can help me make the daytime 10ish minutes and the night time also 10ish minutes. Idk how to do it.
local RunService = game:GetService("RunService")
local Lighting = game:GetService("Lighting")
local function updateTime()
local currentTime = Lighting.ClockTime
local timeInterval = 0.0002
local newTime = currentTime + timeInterval
Lighting.ClockTime = newTime
end
RunService.Heartbeat:Connect(updateTime)
local Lighting = game:GetService("Lighting")
local RunService = game:GetService("RunService")
local Duration = 600 -- day and night duration (in seconds)
local totalTime = 0
local function Update(deltaTime)
totalTime = totalTime % Duration + deltaTime
Lighting.ClockTime = 24 * (totalTime / Duration)
end
RunService.Heartbeat:Connect(Update)