There are no errors, but it just plain doesn't work.
This is the main code:
_G.Censored = {
-- censored words
}
_G.MatchChat = function(msg)
if type(msg) ~= "string" then msg = "" end
for _, v in pairs(_G.Censored) do
lower = msg:lower()
if msg:match(" " .. v:lower() .. " ") then
return true
end
end
end
There are some words in the table, but obviously they aren't appropriate.
Then I call the function MatchChat in the main chat script here:
child.Chatted:connect(function (msg)
if not _G.MatchChat(msg) then
-- updating chat GUI. Removed to make it easier to see the code
end
end)
end)
There are absolutely no errors being returned anywhere, and it still doesn't work. I'm at my wit's end, so I came here for help.

1 comment
This is the full code - that is the function that matches to the table and the actual updating of the Chat GUI works fine.