Hello users as stated above I would like to know if it was possible to make the universal time correspond to the server’s time of day. I already did the part of the script that talks about universal time but now to make it correspond to the time of time of day I don’t know how to do it. What do I need to know to do so I can do it?
What do you mean “Universal time”, do you mean “UTC”?
You could use
Game:GetServices("Lighting").ClockTime = os.date('*!t').hour
is that what you mean?
Yes, that’s what I’m talking about, but I still don’t know how to match UTC with the server clock (I’m not asking for a script, I just want to get a sense of how I could start)
You should combine the Hours, Minutes, and Seconds into one string and then use that string in the Lighting Service.
This should do the trick, every second it will update the value of TimeOfDay to the current UTC time of day. There is a way to match this up to the server so it goes on every actual second, whereas the code below just goes each second after the server opened.
while wait(1) do
local date = os.date("!*t");
game:GetService("Lighting").TimeOfDay = string.format("%.2d:%.2d:%.2d", date.hour, date.min, date.sec);
end;
thank you i forget whenever i can use the while option