How to filter text GUI of radio GUI Roblox

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I want so when players send bad words to radio it gets #

  1. What is the issue? Include screenshots / videos if possible!

I don’t know how to make text filtering

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Looking around forum.

Local script:

local uis = game:GetService("UserInputService")

local activeDisabled = script.Parent.ActiveDisable.activeDisable

local buttonForStatus = script.Parent.ActiveDisable

local remots = game:GetService("ReplicatedStorage").remotes

script.Parent.Visible = true

uis.InputBegan:Connect(function(input, gameProccessedEvent)
	if not gameProccessedEvent then
		if input.KeyCode == Enum.KeyCode.T then
			if activeDisabled.Value == false then
				buttonForStatus.BackgroundColor = BrickColor.new("Dark green")
				buttonForStatus.Text = "On [T]"
				activeDisabled.Value = true
			else
				buttonForStatus.BackgroundColor = BrickColor.new("Really red")
				buttonForStatus.Text = "Off [T]"
				activeDisabled.Value = false
			end
		end
	end
end)

game.Players.LocalPlayer.Chatted:Connect(function(chat)
	if activeDisabled.Value == false then
	else
		remots.chatSentToRadio:FireServer(chat)
	end
end)

buttonForStatus.MouseButton1Click:Connect(function()
	if activeDisabled.Value == false then
		buttonForStatus.BackgroundColor = BrickColor.new("Dark green")
		buttonForStatus.Text = "On [T]"
		activeDisabled.Value = true
	else
		buttonForStatus.BackgroundColor = BrickColor.new("Really red")
		buttonForStatus.Text = "Off [T]"
		activeDisabled.Value = false
	end
end)

Server script:

local remots = game:GetService("ReplicatedStorage").remotes

remots.chatSentToRadio.OnServerEvent:Connect(function(plr, chat)
	for i,v in pairs(game.Players:GetPlayers()) do
		local msgTemplet = v.PlayerGui.radio.msgTextTemplet:Clone()
		msgTemplet.Text = plr.Name .. ": " .. chat
		msgTemplet.Visible = true
		msgTemplet.Parent = v.PlayerGui.radio.Background.ScrollingFrame
		
		local msgTemplet2 = msgTemplet:Clone()
		
		msgTemplet2.Parent = game.StarterGui.radio.Background.ScrollingFrame		
	end
end)

Take a look at this: Text Filtering | Roblox Creator Documentation

I don’t think you should be using custom text filtering. I’m pretty sure Roblox may remove you for that, even with good intentions.
Try using TextChatService:FilterStringAsync(text)

It shouldn’t be too hard to find out how to filter text. It could take a few minutes or hours depending on how well you can use Google. But keep this in mind: Text filtering is disabled in roblox studio. Make sure there are no errors in your code, and then you can test in a real server to see if the filter works.

Even if this radio is only available to a handful of people, there should be text filtering for player-player communication or roblox will not like it.

Client script:
local remots = game:GetService(“ReplicatedStorage”).remotes

remots.chatSentToRadio.OnClientEvent:Connect(function(plr, chat)
local msgTemplet = game.StarterGui.radio.msgTextTemplet:Clone()
msgTemplet.Text = plr.Name … ": " … chat
msgTemplet.Visible = true
msgTemplet.Parent = game.StarterGui.radio.Background.ScrollingFrame
end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.