I'm trying to make a clock that reflects in-game time. It should work fine from what I've seen, except it doesn't. Here's the code:
hour = game.Workspace.Time.Hour.Value
while true do
wait(1)
if hour == 0 or 12 then
script.Parent.Text = "12:00"
elseif hour == 1 or 13 then
script.Parent.Text = "01:00"
elseif hour == 2 or 14 then
script.Parent.Text = "02:00"
elseif hour == 3 or 15 then
script.Parent.Text = "03:00"
elseif hour == 4 or 16 then
script.Parent.Text = "04:00"
elseif hour == 5 or 17 then
script.Parent.Text = "05:00"
elseif hour == 6 or 18 then
script.Parent.Text = "06:00"
elseif hour == 7 or 19 then
script.Parent.Text = "07:00"
elseif hour == 8 or 20 then
script.Parent.Text = "08:00"
elseif hour == 9 or 21 then
script.Parent.Text = "09:00"
elseif hour == 10 or 22 then
script.Parent.Text = "10:00"
elseif hour == 11 or 23 then
script.Parent.Text = "11:00"
end
end
I put some prints in there for debugging and the script runs fine, except for one thing... If I update the text manually, it will set it back to 12:00 no matter what. No matter what the hour value is at, it's going to set it to 12. I'm really frustrated and confused because there doesn't seem to be any problem with the script.

2 comments
You have to update the value of hour in the loop. Otherwise, it'll set it once and always use that value. Put it right after the wait. Also, you can't say `hour == 1 or 13, you must do hour == 1 or hour == 13.
Solved my problem, thanks