Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My Time gui doesnot works?

print("Script Started")
script.Parent.Parent.Lighting.TimeOfDay = "24:00:00"
script.Parent.Parent.StarterGui.GameTimeGui.Frame.TextLabel.Text = "12:00 PM"
wait(1)
print("functionally")
script.Parent.Parent.StarterGui.GameTimeGui.Frame.TextLabel.Text = "12:01 PM"
wait(1)
print("functionally")
script.Parent.Parent.StarterGui.GameTimeGui.Frame.TextLabel.Text = "12:02 PM"
wait(1)
print("functionally1")
script.Parent.Parent.StarterGui.GameTimeGui.Frame.TextLabel.Text = "12:03 PM"
wait(1)
print("functionally2")
script.Parent.Parent.StarterGui.GameTimeGui.Frame.TextLabel.Text = "12:04 PM"
wait(1)
print("functionally3")
script.Parent.Parent.StarterGui.GameTimeGui.Frame.TextLabel.Text = "12:05 PM"
wait(1)
print("functionally4")
script.Parent.Parent.StarterGui.GameTimeGui.Frame.TextLabel.Text = "12:06 PM"
wait(1)
print("functionally5")
script.Parent.Parent.StarterGui.GameTimeGui.Frame.TextLabel.Text = "12:07 PM"
wait(1)
print("functionally6")
script.Parent.Parent.StarterGui.GameTimeGui.Frame.TextLabel.Text = "12:08 PM"
wait(1)
print("functionally7")
script.Parent.Parent.StarterGui.GameTimeGui.Frame.TextLabel.Text = "12:09 PM"
wait(1)
print("functionally8")
script.Parent.Parent.StarterGui.GameTimeGui.Frame.TextLabel.Text = "12:10 PM"
print("functionally9")
script.Parent.Parent.Lighting.TimeOfDay = "00:30:00"

It is not working. The gui doesnot change. all other things works i tested with the print("functionally") text. what i do wrong?

2 comments

0

The location of the script is ServerScriptService

0

So you want us to go though 35 lines of code fixing something we don't even know what the error is? You could at least specify what "functionally" didn't print. Did it stop at functionality 3 or 6? This would be too broad but the fact that you expect us to fix something like this. We're not servants.

1 answer

My best advice is to just use a while true do loop and have it update the time, sorta like this...

secs = 0
mins = 0
hours = 6
gui = script.Parent.Parent.StarterGui.GameTimeGui

while true do
wait(1)
secs = secs + 1
if secs > 59 then
secs = 0
mins = mins + 1
end
if mins > 59 then
mins = 0
hours = hours + 1
end
gui.Frame.TextLabel.Text = (hour..":"..mins.." PM")
game.Lighting.TimeOfDay = (hour..":"..mins..":"..secs)
end

I'm still somewhat tired so I'm not sure if I got everything correct, however this should work.

This discussion is preserved as it was. New answers, comments, and votes are closed.