• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Give Current Gold to Allies.

Status
Not open for further replies.
Level 4
Joined
Aug 5, 2011
Messages
99
made this quickly.. hope it works for you
  • message
    • Events
      • Player - Player 1 (Red) types a chat message containing -gg as A substring
      • Player - Player 2 (Blue) types a chat message containing -gg as A substring
      • Player - Player 3 (Teal) types a chat message containing -gg as A substring
      • Player - Player 4 (Purple) types a chat message containing -gg as A substring
      • Player - Player 5 (Yellow) types a chat message containing -gg as A substring
      • Player - Player 6 (Orange) types a chat message containing -gg as A substring
      • Player - Player 7 (Green) types a chat message containing -gg as A substring
      • Player - Player 8 (Pink) types a chat message containing -gg as A substring
      • Player - Player 9 (Gray) types a chat message containing -gg as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -gg as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -gg as A substring
      • Player - Player 12 (Brown) types a chat message containing -gg as A substring
    • Conditions
    • Actions
      • For each (Integer A) from 5 to (Length of (Entered chat string)), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), (Integer A), (Integer A))) Equal to
            • Then - Actions
              • Set player = (Integer((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string))))))
              • If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to red) then do (Set player = 1) else do (Do nothing)
              • If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to blue) then do (Set player = 2) else do (Do nothing)
              • If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to teal) then do (Set player = 3) else do (Do nothing)
              • If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to purple) then do (Set player = 4) else do (Do nothing)
              • If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to yellow) then do (Set player = 5) else do (Do nothing)
              • If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to orange) then do (Set player = 6) else do (Do nothing)
              • If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to green) then do (Set player = 7) else do (Do nothing)
              • If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to pink) then do (Set player = 8) else do (Do nothing)
              • If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to gray) then do (Set player = 9) else do (Do nothing)
              • If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to light blue) then do (Set player = 10) else do (Do nothing)
              • If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to dark green) then do (Set player = 11) else do (Do nothing)
              • If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to brown) then do (Set player = 12) else do (Do nothing)
              • Set amount = (Integer((Substring((Entered chat string), 5, (Integer A)))))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Triggering player) Current gold) Greater than or equal to amount
                  • ((Triggering player) is an ally of (Player(player))) Equal to True
                  • ((Player(player)) slot status) Equal to Is playing
                • Then - Actions
                  • Game - Display to (All players) the text: (You gave + ((String(amount)) + ( to player + (Name of (Player(player))))))
                  • Player - Add amount to (Player(player)) Current gold
                  • Player - Add (amount x -1) to (Triggering player) Current gold
                • Else - Actions
                  • Game - Display to (All players) the text: You havent got that...
              • Skip remaining actions
            • Else - Actions
to use it type -gg (ammount) (player number or player color)
so -gg 5000 red or -gg 5000 1 will give 5000 gold to red
 

Attachments

  • givegold.w3x
    19.4 KB · Views: 106
Status
Not open for further replies.
Top