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

[ANSWERED] How do you filter strings? (Chat Service)

Asked by
qVoided 221 Moderation Voter
4 years ago
Edited 4 years ago

FilterStringAsync() and FilterStringForBroadcast()doesn't work for me. Any help?

Thanks in advance!

Answers, comments and criticism are welcome :)

0
Make sure to test it from a live game and not from a studio test instance. Rheines 661 — 4y
0
https://scriptinghelpers.org/questions/95354/what-do-the-filterstringasync-parameters-mean#88091 | This will help you understand how to use FilterStringAsync and ForBroadcast(). You will have to configure your script to match whenever the player speaks, it sends an event and you will have to filter it from there. killerbrenden 1537 — 4y
0
Rheines that actually worked lol qVoided 221 — 4y

1 answer

Log in to vote
0
Answered by
JesseSong 3916 Moderation Voter Community Moderator
4 years ago

Make sure this is in a local script. Also put it in starterplayerscripts

local playerFrom = game.Players.LocalPlayer -- Local player (player sending message)
local message = "Hello!","Idk"  -- You can add more words to filter by doing this


FilteredString = game:GetService("Chat"):FilterStringForBroadcast(message, playerFrom)

-- Print the filtered string
print(FilteredString)

This code checks whether the player says a message if they do then it will filter the string.

0
But I'm using remote events, and the event was fired from a local script to a server script. Thanks anyway! qVoided 221 — 4y
Ad

Answer this question