Preferably, you would connect the .Chatted events on the server, filter the message, and send it to all players.
--server
local players = game:GetService"Players"
local txt = game:GetService"TextService"
players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
local res = txt:FilterStringAsync(msg,plr.UserId,Enum.TextFilterContext.PublicChat)
local filtered = res:GetChatForUserAsync(plr.UserId)
RadioMessageOut:FireAllClients(filtered)
end)
end)
--client
RadioMessageOut.OnClientEvent:Connect(function(msg)
--code to display message (ON CLIENT)
end)
Remember to wrap FilterStringAsync in a pcall as it is internally a web call and can fail if the filter endpoint is down. I believe you also meant to have GetChatStringForUserAsync as the method performed on the TextFilterResult.
Confused the function with GetNonChatStringForUserAsync, sorry. The original function should still work fine. I mainly meant to point out wrapping FilterStringAsync in pcall, though.