Hi, devForum!
Due to Roblox’s implementation of chat restrictions, we need a way to signify whether or not certain users can chat with one another. To do this, we’d like to use a system where, in their overhead display, it displays a Can Chat status with either yes or no, depending on age group of the person looking at it.
I did something similar for one game i worked on, you can do this with some TextChatService methods.
When a player joins i first check if they can use the chat in the game using TextChatService:CanUserChatAsync(), if they CAN’T use chat then i store their UserId on a table of player’s who can’t chat, we can use this later on so we don’t have to do checks again on a player that can’t chat at all; If they can use chat then we loop through every single player currently in the game, if the UserId of the player we are currently checking is inside of the table of player’s who can’t chat then we skip over them in the loop using the ‘continue’ keyword, if the player can use chat then we check if the player’s can chat between them using TextChatService:CanUsersChatAsync() we store all this information on a table and we also send this information over to the player we are currently looping over, this is so the other client can set its own overhead display image for the new player, once we finish iterating over all the players we send the table of information to the player that just joined, once the client recieves this info you can use it to set their own display overhead on all the player’s on the server.
I’m not really good at explaining so please let me know if you want me to clarify something or if you have any further queries.
Also remember to clean up player’s id’s once they leave the server or you’ll get yourself a memory leak.