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

Why is my text not being filtered when fired from the server?

Asked by 5 years ago

I am creating an announcement system for my game, where players can announce messages that display on monitors dotted around the map. Though the messages are not being filtered, any ideas?

boards = workspace.Monitors:GetChildren()
game:GetService("ReplicatedStorage"):WaitForChild("SendAnnouncement").OnServerEvent:Connect(function(plr, text)
    for i = 1, #boards do
        if boards[i].Name == "NetworkingMonitor" or "NetworkingMonitorMaster" then
            boards[i].Screen.SurfaceGui.AnnouncementText.Text =     game:GetService("Chat"):FilterStringForBroadcast(text, plr)
        end
        wait()
    end
end)

This is fired from a Script located in ServerScriptService.

0
Try using the TextService instead of Chat. game:GetService("TextService"):FilterStringAsync(text, player.UserId):GetNonChatStringForBroadcastAsync() NotInventedHere 158 — 5y

Answer this question