Dinkleberg's GMod

Full Version: Simple Slur Blocker
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Here's a simple script that prevents a message containing anything in that table from getting sent. Drop it in lua/autorun and you're off to the races. If we get the timed mutes/gags addon I wrote installed, it would be very easy to have this automatically mute the player for a few minutes if they send a message that gets blocked, if we wanted to.

https://github.com/RussEfarmer/bad-word-slur-blocker
https://github.com/RussEfarmer/bad-word-...e/automute

Code:
badwords = {
    "badword1",
    "badword2",
    "badword3",
    "badword4",
    "badword5" -- don't put a comma on the last one
}

function findBadWords(table, text)
    for k,v in pairs(table) do
        if string.find(text, v) then return true end
    end
end

if SERVER then
    hook.Remove("PlayerSay", "nobadword")
    hook.Add( "PlayerSay", "nobadword", function(ply, text)
        if findBadWords(badwords, text) then return "" end
    end)
end
Yes. RIGHT NOW. PLS
thank you stress queen, keep slaying
big moves
staff are annoying so im replacing them all with crappy lua scripts, everyone get out
+1 x 1000000
My problem with this is we are on the internet and this is easily avoidable by either yelling out a slur in the voice chat or replacing one letter in the slur itself. With the n word, I've seen the I replaced with an O and an A. It's nearly impossible to block everything.
(02-20-2021, 09:39 AM)derpĀ sucks Wrote: [ -> ]My problem with this is we are on the internet and this is easily avoidable by either yelling out a slur in the voice chat or replacing one letter in the slur itself. With the n word, I've seen the I replaced with an O and an A. It's nearly impossible to block everything.
The vast majority of slurs are done using the actual word though.
We can st least block the actual words and common variations found - obviously staff are still gonna have to have their ears on
This is a nice script, have you tested it on a server yet?
(02-20-2021, 03:06 AM)RussEfarmer Wrote: [ -> ]staff are annoying so im replacing them all with crappy lua scripts, everyone get out

ASAB!
Pages: 1 2