Board Thread:Support Requests - Community Management/@comment-4570441-20140202205403/@comment-4018164-20140222073810

Callofduty4 wrote: Penguin-Pal wrote: You can copy this script that i wrote recently. You set an array of words that you don't want others to say, and prevents users from sending messages that contain them. It also warns the player (3 strikes and you're out), though you can get rid of it or modify it in any way that you want. Also it was made so it doesn't blocks messages from private messages. This can be disabled as well.

If I may suggest an improvement to your script, you could probably construct one large regular expression and match that against the text posted by the user. At the moment you're constructing $$3 \times b.length$$ regular expressions and performing an equal amount of matches - this is bound to hinder performance when lots of words are used in the array. Thank you for your suggestion :) I'll change the structure of the script to reduce the number of regular expressions to 1.