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

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

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

Thanks in advance!

Answers, comments and criticism are welcome :)

3 comments

0

Make sure to test it from a live game and not from a studio test instance.

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.

0

Rheines that actually worked lol

1 answer

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.

1 comment

0

But I'm using remote events, and the event was fired from a local script to a server script. Thanks anyway!

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