• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Trigger] [GUI] Player 1 types substring

Status
Not open for further replies.
Level 12
Joined
Feb 11, 2008
Messages
809
This trigger will not work can someone please tell me why?

  • nocursing
    • Events
      • Player - Player 1 (Red) types a chat message containing -nocursing as A substring
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 7, 20)) Equal to red
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of Player 1 (Red)) + Can no longer curse/swear during this game.)
          • Trigger - Turn on antiswear 1 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 7, 20)) Equal to blue
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of Player 2 (Blue)) + Can no longer curse/swear during this game.)
          • Trigger - Turn on antiswear 2 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 7, 20)) Equal to teal
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of Player 3 (Teal)) + Can no longer curse/swear during this game.)
          • Trigger - Turn on antiswear 3 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 7, 20)) Equal to purple
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of Player 4 (Purple)) + Can no longer curse/swear during this game.)
          • Trigger - Turn on antiswear 4 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 7, 20)) Equal to yellow
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of Player 5 (Yellow)) + Can no longer curse/swear during this game.)
          • Trigger - Turn on antiswear 5 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 7, 20)) Equal to orange
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of Player 6 (Orange)) + Can no longer curse/swear during this game.)
          • Trigger - Turn on antiswear 6 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 7, 20)) Equal to green
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of Player 7 (Green)) + Can no longer curse/swear during this game.)
          • Trigger - Turn on antiswear 7 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 7, 20)) Equal to pink
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of Player 8 (Pink)) + Can no longer curse/swear during this game.)
          • Trigger - Turn on antiswear 8 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 7, 20)) Equal to gray
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of Player 9 (Gray)) + Can no longer curse/swear during this game.)
          • Trigger - Turn on antiswear 9 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 7, 20)) Equal to light blue
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of Player 10 (Light Blue)) + Can no longer curse/swear during this game.)
          • Trigger - Turn on antiswear 10 <gen>
        • Else - Actions
 
Level 2
Joined
Jul 9, 2007
Messages
7
The substring start and end values are off...

Change them to where the color word would be...

Like (Substring((Entered chat string), 7, 20)) Equal to red
Should be (Substring((Entered chat string), 12, 14)) Equal to red
The two numbers in the substring signify the start and end of what you want to compare.
 
Status
Not open for further replies.
Top