How would I tell if a user has safechat / if their account is 13+?

The title is kind of self-explanatory.

The reason I want to know this is so I can know if it is ok to show the user Discord server links.

I know this is possible because Basic Admin Essentials / BAE can tell if a user is 13+ / has safechat via the :info command

I’ve checked BAE’s module source and they filter “C7RN” using TextService:FilterStringAsync and TextFilterResult:GetChatForUserAsync.

local success, result = pcall(function()
	local filterResult = TextService:FilterStringAsync('C7RN', player.UserId)
    return filterResult:GetChatForUserAsync(b.UserId) ~= 'C7RN'
end)

print('Player has safechat:', success and result or 'Unknown')

Edit: Use incapaz’s solution instead

1 Like

The player object has a property called AccountAge. It’s a readonly that provides the players account age in days:

https://developer.roblox.com/en-us/api-reference/property/Player/AccountAge

1 Like

@Eotecc was referring to an actual age in real life (<13 or >13), not how long it’s been since an account was created. EDIT: @flkfv’s code they provided above should do the trick, however I haven’t tested it myself.

1 Like

Use PolicyService, not hacky methods like checking if a string filters for users under 13. The service also takes into account the policies of where the player lives, so don’t use it to explicitly check if a player is <13

3 Likes

Not what I meant- I mean as in when you sign up when you enter your birthday, seeing if that age is above 13.