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

How do I make something happen when the "Lighting.TimeOfDay" is at a specific time?

Asked by 6 years ago
Edited 6 years ago

Example: Print "Hello World" when is 7pm or more in the game

(I hope you understand, English is not my native language)

0
^ To add on, if you'd prefer to use TimeOfDay, then I would take the first numbers, then compare them. (For example, I would do TimeOfDay:sub(1, 2) == '07') TheeDeathCaster 2368 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago

This is the thing with Lighting.TimeOfDay.

It doesn’t change unless you tell it to.

game:GetService("Lighting").TimeOfDay = 5
Ad
Log in to vote
0
Answered by 6 years ago

If you have a day/night script and the TimeOfDay reaches the desired time (7) then it'll print.

if game.Lighting.ClockTime == 7 then
    print("Hello world")
end

This should work.

Answer this question