I'll show my two different attempted solutions with the drawbacks of each:
A.
while true do
local minutes_after_midnight = lighting_service:GetMinutesAfterMidnight()
if minutes_after_midnight > 59 and minutes_after_midnight < 421 then
wait(speed_wait_time)
else
wait(default_wait_time)
end
minutes_after_midnight = lighting_service:GetMinutesAfterMidnight()
local new_minutes_after_midnight = minutes_after_midnight ~= 1439 and minutes_after_midnight + 1 or 0
lighting_service:SetMinutesAfterMidnight(new_minutes_after_midnight)
if new_minutes_after_midnight == 0 then
day_number = day_number < 7 and day_number + 1 or 1
current_day.Value = days[day_number]
end
end
This one works great. It was also the first I made. However, the sun and moon in the sky are jerky in their movement, which is what I want to fix about this bit of code.
B.
while true do
local current_clock_time = lighting_service.ClockTime
local new_tween_obj
if current_clock_time > 0 and current_clock_time < 7 then
new_tween_obj = tween_service:Create(
lighting_service,
speed_wait_time,
{ClockTime = current_clock_time + 1}
)
else
new_tween_obj = tween_service:Create(
lighting_service,
default_wait_time,
{ClockTime = current_clock_time + 1}
)
end
new_tween_obj:Play()
new_tween_obj.Completed:Wait()
new_tween_obj:Destroy()
if current_clock_time + 1 == 24 then
day_number = day_number < 7 and day_number + 1 or 1
current_day.Value = days[day_number]
end
end
This one works fairly well, but, depending on the time set for how long the tween will take, the clock on the client will display time inconsistently (i.e. skip a minute or several minutes).
I'd appreciate any fixes, alternative solutions, or advice you have to give. Thanks!

4 comments
On roblox's youtube guide for starters has a way of doing it, infact the have a whole episode of it. It was really good and i suggest checking it out.
Good-day!, Narwhal
Doesnt :Créate as second argument should be a tween info? from there you can customise the tween.
speed_wait_time and default_wait_time are defined as TweenInfo.new(somenumber) and TweenInfo.new(somenumber).
That's not what my question's about, though.