How To Know If A User Is 13+

Hello fellow Developers!
I just came up with a question, so basically there’s some features that are only for 13+ Users, like if I put things only 13+ Users can see I’ll have to lock it for <13 Users, but another way is making something toggleable, but the problem is that <13 Users can simply turn it on, the only thing would be to check if the User is 13+, but I don’t know how to do that, so I came here to ask, thanks in advance!

5 Likes
1 Like

It doesn’t really help, sorry :confused:

By Itself, Its not really possible to check if they are actually over 13 as people can simply lie about their age. but you can use PolicyService or have a set Age Recommendation.

1 Like

And how would PolicyService work?

Also I know they can simply lie, you can’t do anything about that

You can use PolicyService to do this

local PolicyService = game:GetService("PolicyService")

game.Players.PlayerAdded:Connect(function(player)
   local success, result = pcall(function()
      return PolicyService:GetPolicyInfoForPlayerAsync(player)
   end)

   assert(success, result)

   if result.AreAdsAllowed then
      print("User Under 13")
   else
      print("User 13 or older")
   end
end)
2 Likes

So this would check if ads are allowed for the User and if they aren’t it will say they are under 13?

uuhhh roblox prevents users under 13 from seeing ads and I used it to check if user is under 13 or not

Okay, but if I’m it wrong in certain Countries you don’t see ads by default, right?

So for taht. It would say they are under 13? I might be saying something wrong tho

I might try if I have a VPN, because I’m not living in one of these countries…

2 Likes

This probably shouldn’t be done anyways; Roblox isn’t allowed to give info like this due to internet safety laws.

1 Like

Player:GetUnder13() is locked for usage, so there isn’t a guaranteed way of checking.
@VSCPlays interesting method, are you sure it works as the OP wants it?

yes i’m sure it does work as @Dede_4242 wants it

1 Like

I think AllowedExternalLinkReferences is best suited for that.

2 Likes

uuhhh it’s a table and they might have some disabled, also it returns a table so you must use for i, v in pairs(table) do or for i, v in ipairs(table) do or even for i, v in table do and i must add a hashtag before the table to get the amount