I know there is Player GetUnder13 but I cannot use that...
Does anyone know how a game can check if user is under or over 13?
It is possible to check if the player is 13+ with a neat trick: use FilterStringForPlayerAsync!
According to the wiki article for FilterStringForPlayerAsync:
Filters a string appropriate to the given player's age settings, so they see what is appropriate to them. This function will only work if called from a Script on the server. If called on a client it will fail.
After testing this with several "naughty words" on two different accounts (my account, which is 13+, and a dummy account that is <13, I came up with several words that get filtered differently between the two, the most benign of which is suck
.
On a 13+ account:
1 | > print (game:GetService( "Chat" ):FilterStringForPlayerAsync( "suck" , player)) |
2 | suck |
On a <13 account:
1 | > print (game:GetService( "Chat" ):FilterStringForPlayerAsync( "suck" , player)) |
2 | #### |
Now all we have to check if the filtered string contains #'s. For that, we can use string.match. string.match returns nil
if it can't find a matching substring. eg:
1 | > print (( "suck" ):match( "#" )) |
2 | nil |
3 | > print (( "####" ):match( "#" )) |
4 | # |
Wrap this in a function, make it return true
if string.match returns something and false otherwise, and you've got a re-implementation of GetUnder13!
1 | function GetUnder 13 (player) |
2 | return (game:GetService( "Chat" ):FilterStringForPlayerAsync( "suck" , player)):match( "#" ) and true or false |
3 | end |
Tested, and this should return false
for a 13+ account and true
for a <13 account.
This is not possible, you can only get the in-game age of a player, This is only the account age . You can't get the age of a roblox player due to security reasons
Locked by User#24403
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?