As a Roblox developer, it is currently impossible to safely filter text created by players who are not present in the current server.
The simplest fix for this would be to make TextService:FilterStringAsync 's fromUserId parameter work for any UserId and not just players who are in the current server.
- Cross-Server Chat
- Items with custom names that persist in the game world across all servers
- Custom text (names, MOTD) that persists in a private server after the owner leaves
Why is it impossible?
- Why not store the unfiltered text and filter it each time? FilterStringAsync requires the sending player to be present in the server, so this is impossible.
- Why not just store the filtered text? FilterStringAsync returns a TextFilterResult instance, which is used to get the final text. Because TextFilterResult is an instance, it can’t persist after the server shuts down using things like DataStores and can’t be sent to any other servers using things like MessagingService. This makes it so only the final string can be saved or sent to other servers, which is not correct.
- Store the filtered text. This is incorrect because it cannot keep up with updates to the text filter and cannot benefit from per-user filtering.
- Store the unfiltered text and then pretend someone else sent it when it’s time to filter. This is incorrect because filtering changes based on the account details of the player who sent it. For example, a 13+ user will get a different result from the text filter than an under 13 user.
If Roblox is able to address this issue, it would improve my development experience because I would be confident that all user-facing text is being correctly filtered without having to do any ugly workarounds like saving filtered text in DataStores or pretending a different player sent the text.
The FilterStringAsync API has a statement which implies this feature is already planned, but I haven’t heard or seen anything about it despite searching the DevForum pretty thoroughly: