No filter in a textlabel

Hello! I’m making an announcement feature that shows what someone says to everyone on my game. As of right now it is working, except for one thing. There is no filter, so someone can say a swear or slur and it wouldn’t filter in the textlabel. How would I add a filter?

Server (in a click detector)

local db = false
script.Parent.MouseClick:Connect(function(e)
	if e.CoolKidPass.Value == true then
	e.OnMic.Value = true
	e.Chatted:Connect(function(c)
		
			if db == false and e.OnMic.Value == true then
				workspace.RemoteEvent10:FireAllClients(c, e.Name)
				
			end	
			db = true
		end)
		end
end)

workspace.RemoteEvent10.OnServerEvent:Connect(function()
	db = false
end)

Client (In a ScreenGui)

local db = false
script.Parent.MouseClick:Connect(function(e)
	if e.CoolKidPass.Value == true then
	e.OnMic.Value = true
	e.Chatted:Connect(function(c)
		
			if db == false and e.OnMic.Value == true then
				workspace.RemoteEvent10:FireAllClients(c, e.Name)
				
			end	
			db = true
		end)
		end
end)

workspace.RemoteEvent10.OnServerEvent:Connect(function()
	db = false
end)

Any help would be appreciated!

Edit: OH MY GOD I FORGOT I CHANGED IT TO A TEXTLABEL AND NOT A TEXTBOX

You would use TextService:FilterStringAsync()

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