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

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

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

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

2 comments

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')

2 answers

This is the thing with Lighting.TimeOfDay.

It doesn’t change unless you tell it to.

game:GetService("Lighting").TimeOfDay = 5

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.

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