Change Chat Message

I have a script that detects when a player chats something

local players = game:GetService("Players")


players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(msg)
		if msg == "TEST" then
--Stuff
		end
	end)
end)

Is there any way for me to change what the player says or deleted it? I have seen Mad City do this with their ??? badge.

1 Like

RegisterFilterMessageFunction

registers a filter function to the chat identified by functionId . Any changes to the message will persist and be displayed when the message makes it through all of the other filter functions. This function is passed the speaker’s name, the message object, and the channel the message originated in.

I put it in the wrong spot…