Tutorial:Making your experience kid-friendly

One of the most important things on Roblox is the kid community. According to Bloxy News in August 2021, nearly 50% of Roblox users are under the age of 13. In order to make your experience kid-friendly, there are multiple features used to reach this goal.

1. Text Filtering
In order to keep your experience safe, you must use a feature called Text Filtering. Text Filtering replaces potentially-inappropriate text into hashtags in order to prevent inappropriate content from going into kid's eyes. This also prevents kids from giving away personal content.

Roblox is certified as kid-friendly, according to a law called COPPA. The Children's Online Privacy Protection Act, abbreviated to COPPA, is a law that states that websites abiding by it must have a protection filter to keep kids from giving away personal information, hence why Roblox chat messages are filtered.

Text filtering is not required for every piece of text. However, Roblox makes it a requirement for user-entered content. This includes, but is not limited to:
 * Naming a pet
 * Sending a chat message
 * Setting a "status" or "bio"
 * etc.

There are many different ways this content can be entered. The most common way is, however, there are different ways content is entered.

In the case of in-experience "chat history" from a private message system, unfiltered messages should be saved to datastores. Displaying the text, however, should be filtered. It is alright to store unfiltered user input in datastores. It is also okay to show visitors their own typed, unfiltered content. However, content displayed to any users other than the original typer must be filtered.

'''NOTICE: The filter functions must be wrapped in a pcall. If they fail, then do not display the unfiltered text, but make a way to handle the filter failure.'''

In order to filter text, there are two methods of the service, which do the work for you.

FilterStringAsync
FilterStringAsync is one of the two filter methods, which requires three inputs: the message, a user, and a second user. This method is used to filter text that goes from one user to another, matching both their settings. This method is commonly used in one-on-one chat, mainly whispering.

FilterStringForBroadcast
FilterStringForBroadcast is one of the two filter methods, which requires two inputs: the message, and a player. This method is used to filter text that can be seen by anyone. The player is the player who initially sent/made the message. This method can be used for many things, including:
 * Chat system
 * Pet/User name
 * etc.

2. Privacy Settings
Parents are given the ability to control who can chat with their kids in game, on the website, and messages. Messages and website are already handled, but as the game developer, it is your job to do the in game part. There are two methods of the service that handle this. The first method is called CanUserChatAsync. This method returns whether or not the player with the given UserId can chat at all. It takes 1 id. This should be used for things such as a custom chat system. The second method is CanUsersChatAsync. This method returns whether or not the players with the given ids can chat. It takes 2 ids. This should be used in a custom pm system, or any way players can directly communicate with each other.