I don't get how to filter. I've tried but I had no success. I also posted a question about it before but nobody responded at all. Here's my script:
local UIS = game:GetService("UserInputService")
local chatbar = script.Parent
UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.Slash then
chatbar:CaptureFocus()
end
end)
chatbar.FocusLost:connect(function(EnterPressed)
if EnterPressed and chatbar.Text ~= "" and chatbar.Text ~= " " then
local message = chatbar.Text
local plr = chatbar.Parent.Parent.Parent
local chatstorage = game.Workspace:WaitForChild("ChatStorage")
local plrmessage = Instance.new("StringValue", chatstorage)
plrmessage.Value = plr.Name..": "..message
wait(0.1)
chatbar.Text = "Press \"/\" to chat!"
end
end)
This is for a custom chat that I'm making. Can someone help?

3 comments
You should use game.GetService("Chat") just to make sure it won't break if for some reason Chat hasn't been loaded into the place yet.
The chat still works the same way -- works perfectly but without filtering. I know this because when I say stuff that roblox would filter, like "oder" or numbers, it didn't get hashtagged
It only filters in online servers, not in Studio.