Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I delete a message from the chat?

I am trying to make an antiscam filter that looks for things like Player.Username.."just got TONS of ROBUX using", kick them from the server, and then deletes the message. This might be more complicated because of the /me part, but how can I delete the message from the chat to reduce the chance of people falling for it.

3 comments

0

hmmm... I always wanted to know how to do that too. Great idea for the anti-scam filter

0

Yes totes agree!

0

/me commands are now disabled by default. https://devforum.roblox.com/t/in-game-chat-me/280889

1 answer

I believe I know the answer! The answer comes from https://developer.roblox.com/en-us/articles/Lua-Chat-System Insert A ModuleScript Inside of Util's parent (I have no idea)

Replace the source of the ModuleScript with:

local util = require(script.Parent:WaitForChild("Util"))
 
function ProcessMessage(message, ChatWindow, ChatSettings)
	if string.sub(message, 1, 5) == "/last" then
		local currentChannel = ChatWindow:GetCurrentChannel()
		if (currentChannel) then
			currentChannel:RemoveLastMessageFromChannel()
		end
		return true
	end
	return false
end
 
return {
	[util.KEY_COMMAND_PROCESSOR_TYPE] = util.COMPLETED_MESSAGE_PROCESSOR,
	[util.KEY_PROCESSOR_FUNCTION] = ProcessMessage
}

It's my first time messing around with the Lua Chat System so yeah.

This discussion is preserved as it was. New answers, comments, and votes are closed.