#filtering system on textbox not working

1 messages · Page 1 of 1 (latest)

normal stone
#

i have searched about how to filter text from a textbox, after many tutorials and forum posts i have came to this

client side

 script.Parent:GetPropertyChangedSignal("Text"):Connect(function()
    if script.Parent.Text ~= "" then
        game:GetService("ReplicatedStorage"):FindFirstChild("filter"):FireServer(script.Parent.Text)
    end
end)

game:GetService("ReplicatedStorage"):FindFirstChild("filter").OnClientEvent:Connect(function(filteredtext)
    if filteredtext then
        print(filteredtext)
        script.Parent.Text = filteredtext
    end
end)

server side

local textService = game:GetService("TextChatService")
game:GetService("ReplicatedStorage"):FindFirstChild("filter").OnServerEvent:Connect(function(player, text)
    local filteredtext = nil;
    local success, err = pcall(function()
        filteredtext = textService:FilterStringAsync(text, player.UserId)
    end)
    if success then
        game:GetService("ReplicatedStorage"):FindFirstChild("Eventos").filtro:FireClient(player, filteredtext)
    else
        game:GetService("ReplicatedStorage"):FindFirstChild("Eventos").filtro:FireClient(player, false)
    end
end)

and its not working, im aware that it doesnt work on studio, published the changes and still not working on the game

rapid iron
#

read this

#

if I remember correctly the filter does not work on studio as you said tho

#

Be careful and test on a real server

normal stone
#

published and didnt worked

rapid iron
#

well, it should work