Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to filter a string or text?

I have a custom chat (finally) But there is a problem! I don't know how to filter the text! If I don't, Roblox would ban my game. I tried :FilterStringAsync(text,userid) but it wouldn't work. Anyone have a function or something for filtering text? Please help in advice!

function filterStrings(stringToFilter, player)
      local stringToShowToPlayer = chatService:FilterStringAsync(stringToFilter, player)		
      return stringToShowToPlayer
end

4 comments

0

We need to see your code.

0

I don't have the code, I'm asking for a function to filter the text.

0

Show us the code you tried.

0

ok

1 answer

There are two problems with your code. One is what filter you are using, the other is how you are using this filter.

  1. FilterStringAsync takes 3 parameters, not 2. it takes text,Playerfrom and Playerto.

2)More important, FilterStringAsync is used with private messages from one player to another, not global chats. For that use FilterStringForBroadcast

This discussion is preserved as it was. New answers, comments, and votes are closed.