How do I filter a string?

Hello!

So I want to make a thing that requires you to text.

But I dont want toxic kids to start spamming the F word, or any bad word!

So I need help from you guys to see how to filter a text. I also want to make it so it works with guis and other. Thank you.

Read up on this article: https://developer.roblox.com/en-us/articles/Text-and-Chat-Filtering


Please make sure to do you research before making topics; there are a lot of topics already on this.
1 Like

Hello!
Have you seen this article? It is about filtering text.

Thanks, but is it on a local script? And does it need RemoteEvents?

FilterStringAsync() should be called on the server as it will fail if called on the client. You need to send the text to be filtered to the server if you are running it from a local script.

Im having problems with theese lines of code:

Output: Unable to cast Instance to int64

(I also published the game but I ran it in studio)

That’s because the :FilterStringAsync() returns a filter result. You need to call the :GetChatForUserAsync() (or something like that) method on the FilterResult before you can print the output.

Be on the lookout for a module I’m making, it simplifies this process :slight_smile:

Ok make a post or something so I can see the module. Better than getting a free model and then seeing it has a virus. Thanks

Yeah, it’s pretty much done but I’m writing a couple functions for it before it gets released.

If the text will only be seen by the local client then there is no need to filter, but if text is ever inputed from a client and the shown to other clients it has to be filtered.