#Text censor not functioning

1 messages · Page 1 of 1 (latest)

lusty palm
#

Hello, I'm currently experiencing a very odd issue. All of my code is functioning properly; text input, server events, text formatting and output. Everything except the censor, and I cannot figure out why. I've been over all of my scripts twice, I've tried rewriting them, the string is input and output without any modifications. Any thoughts?

`local TextService = game:GetService("TextService")

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChatMessageSent = ReplicatedStorage:WaitForChild("ChatMessageSent")

ChatMessageSent.OnServerEvent:Connect(function(player, message)
if typeof(message) ~= "string" or message == "" then return end

local FilteredText
local Success, err = pcall(function()
    local TextFilterResult = TextService:FilterStringAsync(message, player.UserId)
    FilteredText = TextFilterResult:GetNonChatStringForBroadcastAsync()
end)

if Success and FilteredText then
    for _, OtherPlayer in ipairs(game.Players:GetPlayers()) do
        ChatMessageSent:FireClient(OtherPlayer, player.Name, FilteredText)
    end
end

end)`

little wind
#

try testing it in game not in studio

lusty palm
#

As in not pressing the play button in studio but actually going to the game page and opening it there?

lusty palm
#

Thank you it does work. Good god that is unsafe. Why can't you tell if the censor is working or not without publishing the game???