I am trying to build a schedule for my game, and I came up with a solution like this:
local lighting = game:GetService("Lighting")
local current = game.StarterGui.Schedule.viewschedule.current
local nexts = game.StarterGui.Schedule.viewschedule.next
local tim = lighting.ClockTime
if tim >= 7 then
current.Text = ("Wake Up")
nexts.Text = ("Math Class")
end
if tim >= 8 then
current.Text = ("Math Class")
nexts.Text = ("Study Hall")
end
if tim >= 10 then
current.Text = ("Study Hall")
nexts.Text = ("Lunchtime")
end
if tim >= 12 then
current.Text = ("Lunchtime")
nexts.Text = ("Reading Class")
end
if tim >= 14 and tim <= 16 then
current.Text = ("Reading Class")
nexts.Text = ("Science Class")
end
if time >= 16 then
current.Text = ("Science Class")
nexts.Text = ("Dinner")
end
if time >= 18 then
current.Text = ("Dinner")
nexts.Text = ("Party Time")
end
if time >= 20 then
current.Text = ("Party Time")
nexts.Text = ("Bed Time")
end
if time >= 22 then
current.Text = ("Bed Time")
nexts.Text = ("Wake Up")
end
When I test it in game, the text will not update. It starts on Reading Class and Science Class because the test starts at 15 on the Clock Time, but it won't update when it turns to 16. Why is that?

1 comment
Use a .Changed look on the API that is my guess but i don't know if anything you are making a variable for exists try adding print test through each line to identify where it stops and tell me the output error if there is any. You must learn to debug