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

Things not being filtered correctly / being ignored by the script. But why?

Asked by 6 years ago

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.

0
You have to specify a player when filtering a string, otherwise it will not work. Mayk728 855 — 6y
0
This is done from the server. I pin it on a poor unsuspecting player. Check line 2, SebbyTheGODKid 198 — 6y

Answer this question