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.
lower = msg:lower() if msg:match(" " .. v:lower() .. " ") then
I'm assuming you meant:
lower = msg:lower() if lower:match(" "..v:lower().." ") then
Are these both the same type of script?
The reason I ask, because you cannot get the _G. of a LocalScript, from a Server (normal) Script, and vice-versa...
Put the Censor in a ModuleScript. in ReplicatedStorage
Sorry but I need the full code to understand lol