Auto chat moderation

script that shows you a modal when a message sent contains certain words. Modal also shows triggering word.

you need 2 variables for this script, one number variable called “index” and one string variable with a name of your choice with the value being your blacklist in the format below. Note that there are double quoted hints where you need to enter specific things in the code.

[“badword”,“badword”,“badword”]


@playerSendsChatMessage
for ('index', 0, "amount of words in your bad words variable") {
  if (subString(lastChatMessageSenttriggeringPlayer, getStringArrayElement(#index, #"name of your variable with bad words")) == true) {
    showCustomModalToPlayer('<strong>you have been warned!</strong>
</br>
Please refrain yourself from using "' + getStringArrayElement(#index, #"name of your variable with bad words") + '"'
  }
}

feel free to change this and experiment with it as you like!

if you are lazy and just want to copy it all, heres an example game: