Let me try to help here:
Essentially, you’re making a chat system that enables P2P Chat within a specific group.
(In context… that’s a chat between: you, the host; any supervisors, and the attendees)
Let me draft a doodle to explain a bit better here:
image
As you can see, Red, Green, and Yellow can access the chat, whereas Blue cannot.
Correct me if I’m wrong at any stage, ofc, but that is what I assume you’re doing.
The majority of Roblox Chat can fall into 3 primary categories:
- Freeform Chat (ie, type whatever you want)
- Preset Chat (ie, “Hello”, “Yes”, “No”, etc. kinda like among us quick chat)
- Indirect chat (ie, using signs)
In this case, we should use Freeform or Preset Chat.
Freeform chat:
We can use the CanUsersChatAsync provided by TextChatService to determine whether two users can chat to one another.
Using this is better over getting an age group, because this also checks if the user has: A, access to Chat in the first place. And B, abides by Trusted Connections.
Depending on the use cases, you can also use CanUsersDirectChatAsync to check whether a group of players can receive a message, rather than 1-by-1. However, this would have the same restrictions as if someone was using Whisper chat (so if you can’t /w to them, this won’t provide the userID of the user).
Although, sometimes, it is indeed easier to use GetChatGroupsAsync and avoid the Trusted Connection hustle. If two players are in the same Chat Group ID, they can chat to each other. It’s best to check this shortly after a player joins, assigning who the player can and can’t chat with at that point in time, since Chat Group IDs could change within the same session, but wether a user can or cannot chat to a user doesn’t. You also shouldn’t store the chat Group IDs, either.
Once you’ve check if they can chat, then, you can enable filtering.
Your pipeline would be as such:
image
This then becomes a bit of a headache for two users who cannot chat together, as neither will be able to see the other’s message.
(Link to the docs for textchatservice: TextChatService )
Preset Chat:
With Preset chat, there doesn’t need to be any age-group checking, as all users can see Preset chat.
However, the consequence of Preset is that Preset chat cannot exactly be used to communicate or ask questions:
So… it does get a bit confusing when you ask “Is this understood?”, since technically that won’t be permitted under preset chat.
What you could do is sort of like ask a question implicitly, eg, “The time is now 18:48, welcome to this [TRAININGTYPE]. I am [RANK] [NAME]. You should refer to me as [TITLE] and [TITLE] only.”, where the attendees simply say “Understood.” The question is still there, it’s just now shown.
Another annoying thing is that you can’t use punctuation to finish (eg, no full stops), and you need to make it explicit that it’s preset.
One good alternative, however…
Hybrid:
To simplify everything, you could use a hybrid system.
The Freeform chat will be sent to players whom you can chat with, within your age group. Simple.
The interesting thing happens when the chat is being sent to someone you cant chat with.
Roblox has something called a TextGenerator. In a nutshell, it’s AI. Now, we can use that AI to our benefit.
Using TextGenerator, you’d be able to automatically parse natural messages into their closest preset alternatives. You can even use JSON, too. (I actually used TextGenerator to allow players to change settings with natural language, as an example)
You’d be able to type what you want naturally, and once you press ‘Send’, the message is parsed using TextGenerator, and replaced with a preset (using informed changes, eg your display name and stuff). You’re able to see the parsed message and are able to press ‘Send’ once again to send both the natural and ‘preset’ message to all in the bubble.
Although, this becomes a grey zone since technically you’re using preset chat, but it’s automatically chosen for you rather than the game choosing it for you.
It does, aswell as checking if a player is Blocked, has disabled chat, or is a Trusted Connection
This is partly correct - While avoiding age groups can indeed get your game banned, you can also, legitimately, get around age group restrictions with Preset Chat and Trusted Connections.
In games with Freeform user content, drawing is also another alternative. In build-style games, building words is an alternative.
However, these two will be fine if, and only if the game’s purpose is not to bypass chat. (Eg, Starving Artists for drawing)
Additionally, some methods (eg changing your name in adopt me) can be used as other ways to chat, although unintended.
That’s the best I can explain everything in detail with possible alternatives, so hope that helps and clarifies anything! c: