• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Give Interger Amount Trigger Question

Status
Not open for further replies.
Level 7
Joined
Nov 6, 2019
Messages
186
Basically, i wanna add a Trigger, so when i type -IT 100

it adds 100 score to that player i have selected

but want it so only my username can use that command, and the number is whatever i put, so if i put 250, it gives 250, if i do 10 it gives 10

wanted it to add to player interger, so Set variable[Player Number Selected Unit] + 10

Reason one of my maps use a save/load system for interger, however since latest W3 patch like 50% of players lost there score, and only way to fix it is new version per person lost score, so wanna add command so i can just give them it to any anytimes


i got this, and it works but only to player 1


  • GiveInt
    • Events
      • Player - Player 1 (Red) types a chat message containing -IT as A substring
      • Player - Player 2 (Blue) types a chat message containing -IT as A substring
      • Player - Player 3 (Teal) types a chat message containing -IT as A substring
      • Player - Player 4 (Purple) types a chat message containing -IT as A substring
      • Player - Player 5 (Yellow) types a chat message containing -IT as A substring
      • Player - Player 6 (Orange) types a chat message containing -IT as A substring
      • Player - Player 7 (Green) types a chat message containing -IT as A substring
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Name of (Triggering player)) Equal to CBKing#2554
        • Then - Actions
          • Set VariableSet ITGive = (Real((Substring((Entered chat string), 6, (Length of (Entered chat string))))))
          • Set VariableSet ITSet = (Integer(ITGive))
          • Set VariableSet IT[(Player number of Player 1 (Red))] = (IT[(Player number of Player 1 (Red))] + ITSet)
        • Else - Actions
there was no option for me to choose owner of selected unit, i made a trigger like this per player, and now ti dont work at all
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
Change "Player number of Player 1 Red" to the Player number of the player that will gain the score.

Or you can do this:
  • Add Score
    • Events
      • Player - Player 1 (Red) types a chat message containing -IT as A substring
    • Conditions
      • (Name of (Triggering player)) Equal to CBKing#2554
    • Actions
      • Set VariableSet TempIntegers[1] = 0
      • Set VariableSet TempIntegers[2] = 0
      • -------- --------
      • -------- TempIntegers[1] = Player number of the player gaining score --------
      • -------- TempIntegers[2] = Score amount --------
      • Set VariableSet TempIntegers[1] = (Integer((Substring((Entered chat string), 4, 4))))
      • Set VariableSet TempIntegers[2] = (Integer((Substring((Entered chat string), 6, (Length of (Entered chat string))))))
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempIntegers[1] Not equal to 0
          • TempIntegers[2] Not equal to 0
        • Then - Actions
          • Set VariableSet Score[TempIntegers[1]] = (Score[TempIntegers[1]] + TempIntegers[2])
        • Else - Actions
So you type -IT"X" "Y"
X = Player #
Y = Score Amount

If I wanted to add 100 score to Player 2 I would type:
-IT2 100
 
Status
Not open for further replies.
Top