unit Loses an item triggers twice

Status
Not open for further replies.
Level 7
Joined
Jul 4, 2007
Messages
249
Hello! Can someone tell me why this happens? It triggers twice for every item dropped on death.

  • Bagheera save items
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Hero manipulating item) Equal to bagheera_Unit
      • (bagheera_Unit is dead) Equal to True
    • Actions
      • Game - Display to (All players) the text: (Name of (Item being manipulated))
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Bagheera_Items[(Integer A)] Equal to Cheese
            • Then - Actions
              • Set Bagheera_Items[(Integer A)] = (Item-type of (Item being manipulated))
              • Item - Remove (Item being manipulated)
              • Game - Display to (All players) the text: (String((Integer A)))
              • Skip remaining actions
            • Else - Actions
Untitled.jpg
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
When you "Remove (Item being manipulated)" you're probably firing the Event "When a unit loses an item" again. To fix this, turn off the trigger before removing the item and then turn it back on.

I recommend turning off the trigger before the loop and turning it back on after the loop so you only have to turn it off/on once instead of multiple times.
 
Level 7
Joined
Jul 4, 2007
Messages
249
When you "Remove (Item being manipulated)" you're probably firing the Event "When a unit loses an item" again. To fix this, turn off the trigger before removing the item then turn it back on.
Yea that's it! Thanks man :D
 
Status
Not open for further replies.
Top