Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Trying to do a GUI that shows a message depending on the time of Day, script wont work?

Asked by 5 years ago

Not sure how to make this script work, and not sure how / where to make it work

while true do
    wait(.1)
    if game.Lighting.TimeOfDay = (06:00:00)
        script.Parent.Text = "Wake Up"
    end
end

0
Yeah you forgot to add a "Then" at the end of the 'if' statement so it thinks there is another argument. NoirPhoenix 148 — 5y

2 answers

Log in to vote
1
Answered by
Rare_tendo 3000 Moderation Voter Community Moderator
5 years ago

The TimeOfDay property is a string, so do this instead:

while true do
       wait(.1)
       if game.Lighting.TimeOfDay == '6:00:00' then
              script.Parent.Text = 'Wake Up'
       end
end
Ad
Log in to vote
0
Answered by 5 years ago

try this


while true do wait(.1) if game.Lighting.TimeOfDay == "06:00:00" then script.Parent.Text = "Wake Up" end end

it worked when i tested it with a part and textlabel, but idk what you're using it with so it might not work

Answer this question