• 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.

[Trigger] borrow

Status
Not open for further replies.
Level 6
Joined
Aug 13, 2008
Messages
197
hi can someone help me on a borrow trigger. basically it should allow the player to borrow (X) amount from a computer player only to pay-back after (T) amount of time. unfortunally my attempt to make it failed miserably ->
  • borrow backup
    • Events
      • Player - Player 1 (Red) types a chat message containing -borrow as A substring
      • Player - Player 2 (Blue) types a chat message containing -borrow as A substring
      • Player - Player 3 (Teal) types a chat message containing -borrow as A substring
      • Player - Player 4 (Purple) types a chat message containing -borrow as A substring
      • Player - Player 5 (Yellow) types a chat message containing -borrow as A substring
      • Player - Player 6 (Orange) types a chat message containing -borrow as A substring
      • Player - Player 7 (Green) types a chat message containing -borrow as A substring
      • Player - Player 9 (Gray) types a chat message containing -borrow as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -borrow as A substring
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to (Substring((Entered chat string), 9, 13))
          • (Real((Substring((Entered chat string), 9, 13)))) Less than or equal to (Real((Player 12 (Brown) Current gold)))
        • Then - Actions
          • Player - Add (Integer((Substring((Entered chat string), 9, 13)))) to (Triggering player) Current gold
          • Player - Add (Integer(((String((Sign(-1)))) + (Substring((Entered chat string), 9, 13))))) to Player 12 (Brown) Current gold
          • Game - Display to (All players) for 30.00 seconds the text: (|c00FFFF00 + ((Name of (Triggering player)) + ( borrows + (Substring((Entered chat string), 9, 13)))))
          • Wait 180.00 seconds
          • Wait until (((Triggering player) Current gold) Greater than or equal to (Integer((Substring((Entered chat string), 9, 13))))), checking every 1.00 seconds
          • Player - Add ((Integer((Substring((Entered chat string), 9, 13)))) x (-5 / 4)) to (Triggering player) Current gold
          • Player - Add ((Integer((Substring((Entered chat string), 9, 13)))) x (5 / 4)) to Player 12 (Brown) Current gold
        • Else - Actions
          • Game - Display to (All players) the text: |c00FFFF00-borrow (...
 
Level 22
Joined
Jun 24, 2008
Messages
3,050
Well, that wait trigger, you shouldnt use it. Cause if i borrow 1000 and then 1, then i only have to return 1.

You should change the 180 seconds with creating a unit of type (Red borrow) or such, and then set the custom value to the number borrowed. Then create an event, wich should run when the unit dies. Then add the rest of the actions there.
 
Status
Not open for further replies.
Top