Here is what I tried
while true do
script.Parent.TextBox.Text = game.Lighting.TimeOfDay
wait(1)
print("script true")
end
note that it gives back no errors, but it still doesn't print the "script true" so it means the loop doesn't even go that far. Can anyone help me solve this?

14 comments
Is this a local script?
nope it isn't. Can that be why?
@kingdom5 so I just tried with localscript it still doesnt work.
You should use a local script , add a print to the top of the to check that it is being ran. Also where is this script?
@kingdom5 the script is inside the frame together with the textbox.
can you print screen the hierarchy just to save some time.
Nevermind, I got it to work. What I did was just to make a script in workspace, made a "while true do" loop and did game.StarterGui.ScreenGui.Frame.TextBox.Text = game.Lighting.TimeOfDay and that worked.
That will not help as, https://scriptinghelpers.org/blog/common-mistakes#PlayerGui. It is ok to put the script in the gui.
@kingdom5 Ah you're right
Where is the "script" located? In StarterGui I presume? And you should definitely be using a LocalScript.
@wfvj014 Script is located right here: https://gyazo.com/478341d20973c8a5f2d6178ddccf05d5 but it seems to not even respond to print if I use a localscript.
its not disabled is it? print(1) at the top of the script, before anything else, and see if that runs.
Alright, so I finally figured it out. This is how the script looks like
local text = script.Parent.TextBox print('test script running, stage 1') while true do text.Text = game.Lighting.TimeOfDay wait(.1) end