You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
Use os.date in a script to periodically check for date change
What is the issue? Include screenshots / videos if possible!
using os.date as specified seems to hang my game server startup (but not in Studio)
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I think I have found a solution by just using a new variable, just wondering why it would hang using this method.
First I use os.date as follows to create a date key:
local dateTable = os.date("*t", os.time()) local datekey = "Y"..dateTable["year"].."M"..dateTable["month"].."D"..dateTable["day"]
Later in the script, I try to update the existing dateTable variable with the new clock time(to make a new key and compare with the first one):
dateTable = os.date("*t", os.time()) local newdatekey = "Y"..dateTable["year"].."M"..dateTable["month"].."D"..dateTable["day"]
This seems to hang the server during launch, it doesn’t affect Studio or throw an error. It eventually starts but takes maybe 5 minutes to spin up the server and get the first player in. Using a new variable(local newdateTable) to generate the new date key seems to have fixed the hang problem.