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

How do I set the in-game time to current UTC time?

Asked by 3 years ago

I know how to get the time, but I don't know how to change the in-game time to that time.

1 answer

Log in to vote
0
Answered by 3 years ago

Since the TimeOfDay property is a string value, and os.date() can return the hour, minute, and second of the UTC time, we can use this.

game.Lighting.TimeOfDay = tostring(os.date("!*t").hour.. ":".. os.date("!*t").min.. ":"..os.date("!*t").sec)

Remember that UTC must have the "!*t" within the os.date() function

0
local hour, minute, second = unpack(os.date("!*t")) Ziffixture 6913 — 3y
Ad

Answer this question