[Mod] Auto kick players on swear word [WIP] [kickoncurse]

Post Reply
iZacZip
Member
Posts: 48
Joined: Sat Dec 05, 2015 10:37

[Mod] Auto kick players on swear word [WIP] [kickoncurse]

by iZacZip » Post

Hello all,
I've been looking for a mod that kicks players if they swear.
I couldn't find one, so I decided to make one :) not sure if screenshots
are necessary, but I'm working on them.
The code was originally from AiTechEye's misccmd
mod, but I thought that this particular module of it
needed a bit more attention. So here it is!

Add more (temporary):
Copy this code, paste it into the init.lua file and change the swear words listed in it.

Code: Select all

local badwords_kick_saying_F=1

minetest.register_on_chat_message(function(name, message)
	if badwords_kick_saying_F~=1 then return false end
	msg=message:lower()
	if msg:find("fuck") or
	 msg:find("fukc")
		then
		minetest.kick_player(name, "Ey, you. Don't talk like that! It ain't allowed.")
		minetest.chat_send_all(name .. " said a swear word that is not accepted by the server. S/he was kicked.")
		print("badword: <".. name .."> " ..  message)
	else
		return false
	end
end)

DOWNLOADS:
Go to the Github page.
After installation, rename the file from
kickoncurse-master to kickoncurse.
Report an Issue?
Ignore my old posts.

User avatar
lag01
Member
Posts: 293
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag

Re: [Mod] Auto kick players on swear word [WIP] [kickoncurse

by lag01 » Post

Well, i have such mod.
viewtopic.php?t=12617
Interesting to look, how you do this.

iZacZip
Member
Posts: 48
Joined: Sat Dec 05, 2015 10:37

Re: [Mod] Auto kick players on swear word [WIP] [kickoncurse

by iZacZip » Post

lag01 wrote:Well, i have such mod.
viewtopic.php?t=12617
Interesting to look, how you do this.
I see you've used minetest.log. May consider that...
Ignore my old posts.

Post Reply

Who is online

Users browsing this forum: freshreplicant and 4 guests