Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local words = {"swear", "swear", "badword", "another_swear"}
- local gold = minetest.get_color_escape_sequence("#ffdf00")
- local white = minetest.get_color_escape_sequence("#ffffff")
- minetest.register_on_chat_message(function(name, message)
- if not message then
- return
- end
- if not minetest.get_player_privs(name).shout then
- return true
- end
- local msg = message:lower()
- for n = 1, #words do
- if msg:find( words[n] ) then
- minetest.kick_player(name, "( ** WATCH YOUR LANGUAGE ** )")
- minetest.chat_send_all("** " .. name .. " kicked for swearing.")
- return true -- do not show message
- end
- end
- message = message:gsub("%s+", " ")
- minetest.chat_send_all("<" .. gold .. name .. white .. "> " .. message)
- return true
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement