Hey, I have game where an event takes place every Wednesday and Saturday at a certain time, and I am currently trying to make a countdown until the event begins.
I have some experience with scripting, but I have never tried making a countdown of this complexity.
This sciript is from the YouTuber, HowToRoblox, and I was wondering how I would be able to make the script I mentioned.
local day1 = os.time({year = 2021, month = 9, day = 5, hour = 6, min = 0, sec = 0})
while wait() do
local secondsBetween = os.difftime(day1, os.time())
local seconds = secondsBetween % 60
local minutes = math.floor(secondsBetween % (60*60) / 60)
local hours = math.floor(secondsBetween % (60*60*24) / (60*60))
local days = math.floor(secondsBetween % (60*60*24*30) / (60*60*24))
local textString = days .. "d:" .. hours .. "h:" .. minutes .. "m:" .. seconds .. "s"
print(textString)
if secondsBetween <= 0 then break end
end
Any helps as to how to achieve this is appreciated. Thanks for reading.