Hello, I was making a day/night cycle which needs to be synchronized with the server. However, I can’t find a way to make time speed up during certain hours of the day.
- What do you want to achieve?
I want to be able to speed up or slow down the day/night cycle and still be in sync with the server.
- What is the issue?
local hoursPerSecond = 1/60
game:GetService("RunService").Heartbeat:Connect(function()
lighting.ClockTime = workspace:GetServerTimeNow() * hoursPerSecond % 24
end)
Changing the hoursPerSecond variable wont work while the server is running. For example, if I change it to 1/30 the time will speed up but it will be divided by 2, so if it is 6 it will directly go back to.
- What solutions have you tried so far?
For now, I have tried another method: calculating the time in the server and update the lighting with a remote event in the client. This method allows me to change the speed the time is updated, but I am pretty sure it has worse performance.