Here is the code:

function FilterString(str)
	local filtered = game:GetService("Chat"):FilterStringForBroadcast(str,game.Players:GetPlayers()[1])
	if filtered ~= nil then
	return filtered
	end
	return "< Filter Failed >"
end
workspace.DescendantAdded:connect(function(desc)
	local long = desc:GetFullName()
	if desc:IsA("TextLabel") then
		desc.Text = FilterString(desc.Text)
	elseif desc:IsA("TextButton") then
		desc.Text = FilterString(desc.Text)
	elseif desc:IsA("Message") then
		desc.Text = FilterString(desc.Text)
	elseif desc:IsA("Hint") then
		desc.Text = FilterString(desc.Text)
	elseif desc:FindFirstChild("Humanoid") and not game.Players:GetPlayerFromCharacter(desc) then
		desc.Parent.Name = FilterString(desc.Parent.Name)
	elseif desc:IsA("Humanoid") and not game.Players:GetPlayerFromCharacter(desc.Parent) then
		desc.Parent.Name = FilterString(desc.Parent.Name)
	end
end)

Basically anything added to the workspace SHOULD be filtered, but I've seen no effect! (This is for a SB game, and imagine the user is doing something like Instance.new("Hint",workspace)) I have the GUI stuff sorted out, but the workspace seems to just ignore any changes.

2 comments

0

You have to specify a player when filtering a string, otherwise it will not work.

0

This is done from the server. I pin it on a poor unsuspecting player. Check line 2,