Will swear words in scripts get my game banned / shadow banned

I have a trade chat system in my game where players can chat directly to each other during a trade.
I also have a function that I use in this chat called function SensorText()
in which it runs the chat message through an array of swear words and sensors it out.
Will Roblox see these words in the script and assume my game is breaking TOS or whatever or putting this text into the game and then ban the game or shadow ban it?

3 Likes

If you aren’t using Roblox’s default filtering system for user-generated text shown to users(such as the one in a custom chat UI) it’s against the TOS and will get the game banned.

2 Likes

how do I use the default filtering function?
I got the chat idea from pet simulator X who also has a trade chat
so what would they use to filter the chats?

1 Like

Text Filtering | Documentation

1 Like

can I just apply this to any string?

1 Like

Also is it too late. I had the array of swear words in my script which I’ve now removed ( the game has never gone public yet ) Is my game now shadow banned or smth or do I not have to worry since the game was private

1 Like

The Roblox filter function is for user-generated content or content out of your control(such as content fetched from websites). If you have control over a string(let’s say the number of a player’s coins) you don’t have to filter that, because simply since you’re in control, it can’t be malicious.

Do not try to make a custom filter to override the Roblox one, it’s against the TOS. Instead, if let’s say you want to blacklist certain words, you should first check for those words and then apply the actual Roblox filter on top of your own filter result.

2 Likes

Ok so this chat system is user controlled so all I need to do is replace my own SensorText function with TextService:FilterStringAsync()

EDIT: I don’t need to blacklist certain words I didn’t know roblox had it’s own filter function
so I just replace all the uses of my function with the roblox textservice:filterstringasync() ?

2 Likes

This will return a TextFilterResult which is an object/Instance, not the actual filtered string. To fetch the filtered string you should use methods such as GetChatForUserAsync and GetNonChatStringForBroadcastAsync.

1 Like

TextService:FilterStringAsync():GetChatForUserAsync() would give me the string?

3 Likes

It will give you the string for the specific user ID passed to the function. The user ID must be that of the recipient of the message and they should be in the game else it will error.

2 Likes

so I send the chat message to the server for filtering then call the FilterStringAsync:GetChatForUserAsync() and provide the userid of the person receiving the message?

3 Likes

Yes and then you send it back to the recipient through remotes. So the communication is as follows:

  1. Sender sends unfiltered message to the server
  2. Server filters message according to the recipient id
  3. Server returns filtered result to both sender and recipient

The reason I also include the sender is because just as the default Roblox chat, it’s better if you show the sender themselves the filtered version of their message because that provides them with info about what the other player sees and creates a safer environment(although in the textbox the sender is typing you can have the normal input until they press send).

2 Likes

when you say server filters message according to recipient id
I don’t understand what you mean according to the recipient
Surely the filter algorithm is the same no matter what string it is so why does is the recipient at all relevant
What does the recipient have to do with filtering the string

2 Likes

The filter is more strict for younger audiences, so certain words that aren’t filtered for 13+ do get filtered for <13

However, if you want to filter the string in a way safe for all clients, just use GetNonChatStringForBroadcastAsync.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.