Hello, working on censoring a custom name GUI as my game has been closed for moderation due to no filter. The wiki is incredibly vague and it's hard to find anything that clearly explains how to apply any of the functions to a unique script for obvious reasons. This is one of my many failed attempts to apply one of these functions, FilterStringForBroadcast, I'm clearly missing something and would like to know if anyone can help, Thanks! Sam

local Detect = script.Parent.FocusLost
Detect:connect(function()
local player1 = game.Players.LocalPlayer
if script.Parent.Text ~= "" then
player1.leaderstats.Character.Value = script.Parent.Text
player1.Character.Head.BillboardGui.MainFrame.PlayerLabel.Text = script.Parent.Text
player1.Character.Head.BillboardGui.MainFrame.PlayerName.Text = player1.Name
game.StarterGui.Customizer.PositioningFrame.BaseFrame.NameTeamWindow.PlayerName.Text:FilterStringForBroadcast('curseword',player1)
end
end)

5 comments

0

FilteredString = game.Chat:FilterStringForBroadcast(String,PlayerInstance) would do the trick.

0

I'm going to sound like such a twit for asking, but in the parameters, what might I use for String?

0

The string you want to filter...

0

and if I needed to filter a large amount of strings? It just won't work when implemented even when using one test word

0

I would iterate through an array/table of strings to filter,in that case.