I want to delete chat messages when a chat command is sent (not the default chat commands, custom ones made by me) so they dont show up to the player or anyone else, I tried following this guide but it didn’t work, I need help.
Im using the same thing as this, but its not, not sending it if it makes sense.
Script:
local util = require(script.Parent:WaitForChild("Util"))
function ProcessMessage(message, ChatWindow, ChatSettings)
if string.lower(tostring(message)) == "!buy space" or string.lower(tostring(message)) == "!buy speed" or string.lower(tostring(message)) == "!help" then
return true
end
return false
end
return {
[util.KEY_COMMAND_PROCESSOR_TYPE] = util.COMPLETED_MESSAGE_PROCESSOR,
[util.KEY_PROCESSOR_FUNCTION] = ProcessMessage
}
The person who made the guide made another post on another post which was not the guide post about putting it in a module script, I thought module scripts are server sided too?
function ProcessMessage(message, ChatWindow, ChatSettings)
if string.lower(tostring(message)) == "!buy space" or string.lower(tostring(message)) == "!buy speed" or string.lower(tostring(message)) == "!help" then
return true
end
return false
end
local function processMessage(message)
if string.lower(tostring(message)) == "!buy space" or string.lower(tostring(message)) == "!buy speed" or string.lower(tostring(message)) == "!help" then
return true
end
return false
end
local function runChatModule(ChatService)
ChatService:RegisterProcessCommandsFunction(processMessage)
end
return runChatModule