• 🏆 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] 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