Radio GUI Script Doesn't Work

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)
2 Likes

Would RadioMessageOut be the Remote Event?

1 Like

Yes, RadioMessageOut would be the RemoteEvent.

1 Like

This script worked, thank you so much!

3 Likes

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.

https://developer.roblox.com/api-reference/function/TextFilterResult/GetChatForUserAsync
This works fine? I didn’t see anything for GetChatStringForUserAsync.

Confused the function with GetNonChatStringForUserAsync, sorry. The original function should still work fine. I mainly meant to point out wrapping FilterStringAsync in pcall, though.