Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Slur Blocker
#1
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
[Image: horizontal-design-element-3.png]
  Angel I CRAHSED MY CAR
find out more at https://russefarmer.com/
Garry's Mod Performance Tuning Guide
#2
Yes. RIGHT NOW. PLS
[Image: 955ef7a32696f2e506ea3319fcb5017a.png][Image: Banned-Gravity-Small.jpg]
Resigned prop hunt trusted 4/16/2021 - 1/1/2022 <3
#3
thank you stress queen, keep slaying
[Image: ezgif.com-effects.gif?ex=66308f7a&is=661...height=424]
find more through my linktree | Never Forget | Green Bean
#4
big moves
#5
staff are annoying so im replacing them all with crappy lua scripts, everyone get out
[Image: horizontal-design-element-3.png]
  Angel I CRAHSED MY CAR
find out more at https://russefarmer.com/
Garry's Mod Performance Tuning Guide
#6
+1 x 1000000
[Image: Bry-Donor-2.gif]
#7
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.
#8
(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
[Image: dan_ceebeast_gif.gif]

Discord Admin - April 2021 - March 2023
TTT Moderator - February 2021 - March 2023
Join our discord: discord.gg/dinks
#9
This is a nice script, have you tested it on a server yet?
The local Sega & Sonic fanatic.
[Image: JCMB8GH.jpeg]
#10
(02-20-2021, 03:06 AM)RussEfarmer Wrote: staff are annoying so im replacing them all with crappy lua scripts, everyone get out

ASAB!
[Image: h4r1WLO.gif]
Good Games
Retired TTT Moderator
03-07-2020 ~ 11-17-2020
Unofficial Retired Murder Test-Moderator
11-06-2019 ~ 11-17-2020


Forum Jump:


Users browsing this thread: 1 Guest(s)

About Us
    This is Dinkleberg's GMod, a gaming community based in Garry's Mod. We have a Trouble in Terrorist Town, Prop Hunt, Murder, and Deathrun Server. Come check them out sometime.