Why does `Player:SetAccountAge` exist?

What is the point of it? I can’t figure out a single application you would need it for.

1 Like

The best explanation is already on that documentation:
Like to get if player new in roblox or not, but anyway code that is in documentation aint working in scripts, thats all because its maybe works in plugins and command bar as said in documentation. (Totaly not tested)

local function onPlayerSpawned(player, character)
	local head = character:WaitForChild("Head")
	if player.AccountAge >= MIN_AGE_VETERAN then
		mark(head, "Veteran Player")
	elseif player.AccountAge <= MAX_AGE_NEW_PLAYER then
		mark(head, "New Player")
	else
		mark(head, "Regular Player")
	end
end

The more you delve into this topic, the more you will understand why it is.
And the second is Player:SetAccountAge(number) … Uhhh complently this function do not work in simple scripts/local scripts, only in command bar or plugins as said in documentation.
ima21312321ge

Copmpletly maybe no one knows truth of existening this.

1 Like

for internal use at roblox. its security level is “Plugin” so games can’t do anything with it, even if they tried. even if they could, it would only affect the current game, so there’s really no point.

probably just a remnant of the 2010-ish era (see also: Player:SetSuperSafeChat which refers to a removed feature, or Enum.MeshType.Prism which references a removed mesh).

to find a real answer, someone would need to dig through old versions of roblox to experiment, which is a lot of effort for little gain.

1 Like

The year is 2014. “Happy” by Pharrell Williams is the #1 charting song, and Pluto has been demoted as a planet for 8 years. You are a Roblox developer in a world where FilteringEnabled has existed for less than a year, and you are worried about ne’er-do-wells. You decide that it’s worth it to treat players with a very low account age with more ire, or maybe even kick them!

In this pursuit, you would like to test that your scripts actually work (or you discover that Play Solo gives you accounts that report an age of 0). Thus, :SetAccountAge is born.


TLDR: It’s an old legacy function that nobody should have a reason to use, and should probably be deprecated. :slight_smile:

Source: I dug through old versions of Roblox to experiment, which was a lot of effort for little gain

11 Likes

That makes a lot of sense lol, but I suppose they could have just replaced the if player.AccountAge < ... with if true then or even removed the statement altogether.

Nonetheless, a very interesting piece of Roblox trivia!

1 Like

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