Can't Understand This Event: Skript

Discussion in 'Spigot Plugin Development' started by Zoqx, Jan 13, 2019.

  1. Code (Text):
    on chat:
        if message is "bitch":
            cancel event
    Can someone help? I keep running into a can't understand this even: onChat and I can't find a fix, still pretty new to this so probably something stupid
  2. I am no a skript developer but is very simple understand this becouse is like read when a player chat if the message is any text the event was canceled.
  3. What?... I'm pretty sure skript is indent based, like python. the way this is written, I can only assume on chat is skript's version of an AsyncPlayerChatEvent, (which an issue could be that OP is writing the event name incorrectly, for instance, it may be case sensitive, or don't allow spaces. the line "if message is 'bitch'" could be a logic error as well, as then the event would only cancel if the that is the exact message. Assuming the author meant it to be a swear filter, he probably wants the skript equivalent of "contains"
  4. Idk if a contais but a equals yes
  5. You'll have to look into what they mean, but what you want is a function for your message similar to java's contains, though I'm not sure what that would be

Share This Page