game.Players.ChildAdded:connect(function(plry) if plry:IsA("Player") then plry.Chatted:connect(function(msg) local color = {"White"} local chat = game:GetService("Chat") chat:Chat(plry.Character.Head), msg, color[math.random(1,1)] ) end) end end)
FilterStringAsync is what Roblox expects you to use for chat messages. In short, it takes three arguments. These arguments are, (the string, player who the string is from, player who the string is to).
What you'll want to do is run the unfiltered chat message to a server-script (since FilterStringAsync from LocalScripts is deprecated).
.Chatted:Connect(function(Message) game:GetService("ReplicatedStorage").RemoteEvent:FireServer(Message) end)
You will then catch the message on the server's end, and iterate between each player and return it to the respective client.
.OnServerEvent:Connect(function(From, String) for _,v in pairs(game:GetService("Players"):GetPlayers()) do local FilteredString = game:GetService("Chat"):FilterStringAsync(String, From, v) ReplicatedStorage.RemoteEvent:FireClient(v, FilteredString) end end)
You then catch the filtered string on the client, and use it as you want. In this case run it to your custom chat or whatever.