How to make a Flex Your Account Age-esque year system?

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?

1 Like

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

1 Like

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 )

os.date() lua expressions table

2 Likes

some years are 366 days. We need a more accurate system

1 Like

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")
2 Likes

image
i believe the script worked lol

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.