Hello. As my Questions states, I am attempting to create a script that prevents a message from being sent.
local Chat = game:GetService("Chat")
local ReplicatedModules = Chat:WaitForChild("ClientChatModules")
local ChatSettings = require(ReplicatedModules:WaitForChild("ChatSettings"))
local ChatConstants = require(ReplicatedModules:WaitForChild("ChatConstants"))
local ChatLocalization = nil
pcall(function() ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization) end)
if ChatLocalization == nil then ChatLocalization = {} end
if not ChatLocalization.FormatMessageToSend or not ChatLocalization.LocalizeFormattedMessage then
function ChatLocalization:FormatMessageToSend(key,default) return default end
end
local function Run(ChatService)
local function ProcessCommandsFunction(fromSpeaker, message, channel)
if (message:lower() == "bread") then
print("message")
return true -- People say that this is what deletes the message.
end
end
end
return Run
The script is inside ChatModules, which is inside Chat.
However, when I type in "bread" into chat, it will not delete. Any ideas why?
Thanks, LennyPlayzYT

2 comments
i have never used chat but by looking at you ProcessCommandsFunction function, you don't seem to be connecting it anywhere, is that supposed to be?
oh yea, he doesn't connects it anywhere