Simple AntiSwear (what I have been working on)

It only took me an hour, but I made this:


AntiSwearMessages = { "I tried to swear, and ofcourse failed.", "Wow, I do hate myself.", "You know, I hate swearing now!" }
AntiSwear = {}
AntiSwear[1] = { "fuck", true } -- True means will display a random AntiSwearMessages message, false means it wont display anything.
AntiSwear[2] = { "this server sucks", false } -- Too make more swear words, just copy and paste but change the number to the next in line number.

local function AntiPlusStartup( ply )
   timer.Create( ply:UniqueID().."_AntiSwearAndSpam", 1, 0, AntiSS )
end
hook.Add( "PlayerInitialSpawn", "AddonSpawn", AntiPlusStartup )

local function AntiSS( ply, text, team )

   local text = string.lower( text )
   
   for k,v in pairs( AntiSwear ) do
   
	if ( text == v[1] ) then
	    
		if ( v[2] == true ) then
		   return AntiSwearMessages[ math.random( 1, #AntiSwearMessages ) ]
		   else
		   return ""
		end
		
	end
   
   end
	  
   end

end
hook.Add( "PlayerSay", "AntiSwear and Spam", AntiSS )

I don’t know why, but I got bored. And I just want to share it, untill I turn this AntiSwear into a big addon. But anyway, here is the Lua Script. /\ And if it don’t work, then I have no idea, just tell me and ill fix it.

Enjoy, - Jacob

It saddens me deeply that a fellow australian would attempt to censor the good banter
also what the fuck are you doing with those tables holy shit my brains are prolapsing out of my ears



AntiSwear = {}
AntiSwear[1] = { "fuck", true } -- True means will display a random AntiSwearMessages message, false means it wont display anything.
AntiSwear[2] = { "this server sucks", false }


should be



AntiSwear = { "fuck", "OP is a faggot", "sample text" }


and checked with table.HasValue( AntiSwear, txt )

So I can just do “This server fucking sucks” and it’s all good. If you want to do this the right way, a substring check would be best.

swearing filters are useless

This.

Why the fuck would you want to censor it, especially in GARRY’S MOD?

Swearing filters are just annoying and don’t do anything as they’re simple to bypass.

It’s a nice job with the code, but aye, censoring swearing seems silly on the internet. It’s like those “christian” servers in killing games that ban you for swearing… even though you’re shooting people in the face, murdering everything in sight.

What about swearing in Chinese, … L33t sw34|2!n9 (leet swearing), et cetera? …
That is just…

Good luck on impossible mission.
So, yes, I agree with the most of that is already pointed out.


(User was banned for this post ("Image macro" - Craptasket))

A good profanity filter should be able to tell when a suspected swear is actually a component of a larger, non-vulgar word. Else you’ll make everyone snigger when someone tries to talk about the town of Scunthorpe or the Suez Canal.

what the fuck is this degenerated giant pile of horse shit addon, what god damn autistic fantasies is the creator satisfying with this completely puked out abomination piece of shit code?

holy fucking dog crap, I can hardly believe this is for real guys.

And the server even, don’t get me started on this completely fucked up collective of wasted DNA filling up the slots of that like the holes of a crack prostitute.

PS:
Nothing of the above should be taken seriously.

Also, you are much better off with a “behave properly, use common sense” rule than some sort of automatic filter, provided your staff knows how and when to enforce said rule without allowing a lot of space for discussion.


(User was banned for this post ("Terrible post :(" - Big Dumb American))

sounds consistent :v:

battlefield games are the worst with this, your ingame character will literally swear like a sailor and yet servers will AUTOMATICALLY PERMA-BAN you for swearing because they’re “family friendly.”

delete your acocunt


(User was banned for this post (""delete your account"" - GunFox))

https://yasbit.ch/shillary


(User was banned for this post ("shit reply" - GunFox))