Chat Word Filter - v1.0

Hello Guys :slight_smile:

I am releasing a script to stop players from writing words you do not like.
Players with chatfilter:bypass ace are ignored and still allowed to enter forbidden words.

Configuration
-- what should happen when someone enteres a bad word
-- "delete": delete the message
-- "kick": kick the player and delete the message
local mode = "delete"

-- kick message (if 'mode' is set to 'kick')
local kickmessage = "Swearing is not allowed."

-- blacklisted words (in lowercase)
local blacklist = {
	"some",
	"example",
	"words"
}

WARNING: This script is not compatible with other chat-scripts like my AutoReply-System.

If you block the word example, players will not be able to write exxample, exam.ple, ex@mple, exampl3 and many other aliases.

:arrow_down: Download :arrow_down: (1.0 KB)

Idea by sheriff.smiley

6 Likes

Perfect for my christian drift server!

7 Likes

Cool concept dident think of it nice work thanks!

2 Likes

simple more functional beautiful work thanks for sharing

1 Like

Thanks! This will help remove some trolling from my server!

1 Like

how do I make this work with esx_rpchat?

also how do you use the chat filter for /ooc /ad /twt etc

WARNING: This script is not compatible with other chat-scripts

Sorry :wink:

does this work with ace perms ?

Yes. Ace to bypass this filter: chatfilter:bypass.

Some words are still bypassed , In the N Category

Could you show me your configuration?
And maybe the words which bypass it?

server.txt (7.3 KB) i put this in txt to download.

It seems the script has problems with words that have double letters in them, like for example “lesser” or “logger”, etc. It is the “if(char ~= lastchar)” condition that is causing this problem. One solution is to add an iteration counter (i) that you increment in the loop and change the if statement to “if(i < string.len(finalmessage))”.

I’ll take a look at it.

amazing script works flawlessly, thank you !!

Is this going to work with the default ooc in RP servers?

Probably not… this is made for default FiveM chat and might work with only a few custom ones.

You will have to try.