I’ve been wondering how to make something similar to that, I’ve found some things relating to it but it seems like they’re all in a system of days instead of year
Do you mean Player.AccountAge / 365
?
I think? I’m slightly unsure as in FYAA it shows the full year instead of like “7 Years” above the players head which is what im looking to replicate, if that works for that then i believe so
You can use Player.AccountAge / 365
to get how many years the player has had an account. Using os.date("%Y")
you can get the current year we’re in. After that, all you have to do is subtract the account creation year from the current year ( (os.date("%Y") - (Player.AccountAge / 365) )
local PlayersCreationYear = Player.AccountAge / 365
local CurrentYear = os.date("%Y")
local YearsSinceCreation = ( CurrentYear - PlayersCreationYear )
some years are 366 days. We need a more accurate system
Here, it should return years ago with how many years.
local Days = 730 -- Player.AccountAge
local PlayersCreationYear = math.floor(Days / 365)
local CurrentYear = os.date("%Y")
local YearsSinceCreation = ( CurrentYear - PlayersCreationYear )
function dayConvert(n:number?):number?
local years = math.floor(n / 365)
----local months = math.floor((n - (years * 365)) / 30) optional month
----local days = n - (years * 365) - (months * 30) optional days
return tonumber(string.format("%i",years))
end
print(YearsSinceCreation, dayConvert(Days).." years ago")
i believe the script worked lol
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.