So I made a signboard and players can change the text of the textlabel on the surface of the signboard. Players can change the Text of the Textlabel through a TextBox in GUI. I want to apply the Filter so the curse words can be filtered. How do I do that?
✓ ANSWER ACCEPTED
How to Apply FilterString to A TextLabel on SurfaceGUI?
2 answers
✓ Accepted answer
plr = game.Players.Era_Gamer
textlabel = "Test Text"
chat = game:GetService("Chat")
local filter = chat:FilterStringForBroadcast(textlabel,plr)
print(filter)
-- Output: Text Text
You could use RemoteEvent which I fiind it very helpful. Even though you can filter through local scripts I still use the "old" way I guess
--Inside Script
local RE = Instance.new('RemoteEvent', game:GetService('ReplicatedStorage'))a
RE.Name = 'FilterEvent'
RE.OnServerEvent:connect(function(Player, String)
String = game:GetService('Chat'):FilterStringAsync(String, Player, Player)
print(Player.Name..': '..String)
--Do your stuff here
end)
How to use it:
--Inside Local
local RE = game:GetService('ReplicatedStorage'):WaitForChild('FilterEvent')
--When you want to filter a string
RE:FireServer(StringHere)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Change "Test Text" to the text in TextLabel, change plr to whatever player you're talking about (may end up using game.Players.PlayerAdded for this), don't mess with filter, and use return instead of print, or directly make the text the filter.
Thanks for the help. I never thought it was so simple