Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to filter a string or text?

Asked by 6 years ago
Edited 6 years ago

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
0
We need to see your code. lukeb50 631 — 6y
0
I don't have the code, I'm asking for a function to filter the text. User#21146 0 — 6y
0
Show us the code you tried. lukeb50 631 — 6y
0
ok User#21146 0 — 6y

1 answer

Log in to vote
0
Answered by
lukeb50 631 Moderation Voter
6 years ago

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

Ad

Answer this question