• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Sending resources with commands

Status
Not open for further replies.
Level 6
Joined
Jan 16, 2017
Messages
110
Hi i have a question how to make working trigger/s that will allow players to send resources with commands?
i want to make it like in troll and elves i know almost everything that i need except taking number that player entered in the message.
 
Level 12
Joined
Dec 11, 2014
Messages
665
  • DonatingResources
    • Events
      • Player - Player 1 (Red) types a chat message containing -gg as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 4)) Equal to -gg
    • Actions
      • Set String[1] = (Substring((Entered chat string), 5, (Length of (Entered chat string))))
      • Set Converted[1] = (Integer(String[1]))
      • -------- no one --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SellectedPlayer[1] Equal to 0
        • Then - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: select a player to ...
        • Else - Actions
      • -------- Player1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SellectedPlayer[1] Equal to 1
        • Then - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: you cant send gold ...
        • Else - Actions
      • -------- Player2 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SellectedPlayer[1] Equal to 2
        • Then - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: (you just send + ((String(Converted[1])) + ( gold to + (Name of Player 2 (Blue)))))
          • Player - Add (0 - Converted[1]) to Player 1 (Red) Current gold
          • Player - Add Converted[1] to Player 2 (Blue) Current gold
          • Set Converted[1] = 0
        • Else - Actions
Just add a condition to check if Converted is less than 1 and if the player has enough gold. You can open my map (go to my resources) and check the trigger for sending gold there, it should be exactly what you're looking for with minor differences
 

Attachments

  • asdf1.w3x
    14.5 KB · Views: 38
Last edited:
Status
Not open for further replies.
Top