I’m trying to make my day/night cycle speed up when it hits night time, around 6pm. I’ve tried several ways to make it use a value, to just changing the “tpm” value to a different, smaller value. I’ve looked around the forums and have found only one thing that’s even close to relating to what issue I’m having, and it’s a tutorial on how you can make a Custom daylight cycle.
local lighting = game:GetService("Lighting")
local replicatedStorage = game:GetService("ReplicatedStorage")
local event = replicatedStorage:findFirstChild("Time")
local tpm = 2
local suffix
local function to12H(hour)
hour = hour % 24
return (hour - 1) % 12 + 1
end
while wait(tpm) do
local hours = math.floor(lighting:GetMinutesAfterMidnight() / 60)
local minutes = lighting:GetMinutesAfterMidnight() - (hours * 60)
if hours > 11 then
suffix = "PM"
end
if hours < 11 then
suffix = "AM"
end
--[[
this is what one of my attempts looked like
if hours == 22 then
tpm = 1.4
end
if hours == 6
then
tpm = 2
end
]]--
if minutes < 10 then
minutes = "0" .. minutes
end
local text = to12H(hours) .. ":" .. minutes .. " " .. suffix
event:FireAllClients(text)
lighting:SetMinutesAfterMidnight(lighting:GetMinutesAfterMidnight() + 1)
end
Any help would be appreciated.