I’m trying to make a code script that can have codes expire after a certain date. I made a test code that expired in 1999 in 2022, so you’d think it would be expired but it isn’t.
local CodeScript = require(script[CodeName]) -- The Code ModuleScript
local date = os.date("*t")
local expire = CodeScript.ExpireDate -- Expiry Date in Script
if date["day"] >= expire.Day and expire["month"] >= expire.Month and date["year"] >= expire.Year then
print("expired!")
return "Expired"
end
When I run the code, the “Expired!” print does not show up. Is there something I’m doing wrong?
code.ExpireDate = {Year = 1999, Month = 8, Day = 31, Hour = 0, Minute = 0, Second = 0}
this is the Expiry Date in the ModuleScript by the way.