Make function for block addon when when the date doesn't match. The problem is, if the time on the computer is not correct, the function will fail. The idea is to also simultaneously check the day / month / year on the server. But duno how make it.
Lua Code:
GetKeyDate = function()
local KeyExpiration = { year = 2022, month = 08, day = 08, hour = 00, min = 00, sec = 00 }
local KeyDate = time(KeyExpiration)
return KeyDate
end;
GetRealDate = function()
local OSDate = time()
return OSDate
end;
GetLicenseTime = function()
local function Calculate(time)
local day = floor(time/86400)
local hour = floor(mod(time,86400)/3600)
local minutes = floor(mod(time,3600)/60)
local seconds = floor(mod(time,60))
return format("%dd : %02dh : %02dm : %02ds", day, hour, minutes, seconds)
end;
local TimesLeft = GetKeyDate() - GetRealDate()
local date3 = Calculate(TimesLeft)
return date3
end;