How To Moderate A String

So Roblox has it’s own game moderation like tagging chat and what not. But I want to know how I can take any given string and use a script to put it through the typical Roblox tagging process. Like how could I take a string and make sure it is appropriate the exact same way Roblox does.

And if you would like background, I am making a system for my game which generates a username for a player. That part is done, but it is very free if you will. If given the lucky shot of some probability, it could spell out a curse word.

(RP) Game BTW

All help appreciated.

i thing you want a chat filter

those filters are not limited to the chat

So this I did find helpful. However I have one question. My question is when you sign up for Roblox, is the filter for the username the same for the chat filter in Roblox games?

The filter of a username is close to the FilterStringForBroadcast, but of course roblox uses their own API

1 Like

You’re going to have to use the TextService’s method FilterStringAsync.

In short, it’ll look something like such:

local rawStr = "hello this is a bad word"
local str = TextService:FilterStringAsync(rawStr, userId)
print(str) > "hello this is a ### ####".
1 Like

What exactly is the UserId argument for?

I assume its to filter based on the user, so that 13+ users have different filtering system below 13 has a different one.

Well right now I just have the system set up to make the names and print them. So I really don’t have a specific UserId or client to use as an argument.

Well you could pass your own user Id as a template for now.

Yeah, this service I learned not even 1 minute after the post was made, so I experimented with the broadcast one from the Chat service and it said that the UserId must be owned by a present player in the server.

I put in 10

You could let the client create the username and for displaying filter it specifically for all other players in the server with this way you could use user Id and filter it for all players.

2 Likes