Ok I changed it a little bit, but not tested yet.
WordD = { "word1" , "word2" }
function WFilter( ply, text, toall )
local WordC = nil
for _, v in ipairs( WordD ) do
if string.find( text, v, 1, true) then
WordC = found
end
if WordC == found then
text = string.Replace(text, v, "****")
end
end
if WordC then return text else return end
end
hook.Add( "PlayerSay", "WFilter", WFilter )
==EDIT==
Tested, Failed
also tried
WordD = { "word1" , "word2" }
function WFilter( ply, text, toall )
local WordC = nil
for _, v in ipairs( WordD ) do
if string.find( text, v, 1, true) then
WordC = found
if WordC == found then
text = string.Replace(text, v, "****")
end
end
end
if WordC then return text else return end
end
hook.Add( "PlayerSay", "WFilter", WFilter )
Same result.