(Posted Deleted by author)
(Posted Deleted by author)
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.
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.
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() ?
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
.
TextService:FilterStringAsync():GetChatForUserAsync() would give me the string?
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.
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?
Yes and then you send it back to the recipient through remotes. So the communication is as follows:
- Sender sends unfiltered message to the server
- Server filters message according to the recipient id
- 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).
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
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
.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.