How to detect when a day has passed?

I’ve been working on this weekly auctioneer thing, and I want the auction to open every Saturday. The problem is, I don’t really know how I would detect when the day (in real life) has passed.

Is there some kind of event? Some kind of API that I don’t know? Please let me know

1 Like

You could probably use os.date() I believe.

Yes, but HOW would I detect if it’s changed?

What do you mean by changed? It is automatically updating like other things (os.clock(),os.time()) etc.
try to make script and print

while wait(1) do
    print(os.clock())
end

And let me know if its changing or not ;).

or try to print the os.date()

local datex = os.date("*t")
print(datex) --table with all things such as second,minutes,hours,days,etc.
3 Likes

My god. Why haven’t I thought of this???

Anyways, thanks a lot man. I had a brain fart :joy:

1 Like

No problem :smiley:!
I am glad that I helped :wink:.

2 Likes