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

Make consumable item that kills the user doesn't drop on the ground upon death

Status
Not open for further replies.
Level 3
Joined
Aug 24, 2014
Messages
22
So I have an item that when casted on a target will have a 50% chance for the user to deal damage to the target and 50% chance for the target to deal damage to the user. The item is suppose to be a consumable so when you use it, it will go away. But if the user gets killed by the item, the item doesn't get consumed but drops on the ground instead. Is there a way to make the item dissapear?
 
Level 3
Joined
Aug 24, 2014
Messages
22
Sorry that's not what I meant. The item already drops upon death. What's wrong is that if you use the item and get killed by it, the item will drop on the ground, which it shouldn't because it is a consumable.
 
  • Events
    • Unit - a unit dies
  • Conditions
  • Actions
    • Pick all items in (playable map) and do
      • Actions - Loop
        • If all Conditions are true then do actions
          • Conditions
            • (Item-Type of (Picked Item)) Equal to (Item-Type of Your_Item)
          • Actions
            • Then do
              • Item - Remove (picked item) from game
              • Else do
You can also check to make sure that the item is the closest item to the dying unit, in case there are other item-types matching your item.
 
Level 12
Joined
May 22, 2015
Messages
1,051
  • Events
    • Unit - a unit dies
  • Conditions
  • Actions
    • Pick all items in (playable map) and do
      • Actions - Loop
        • If all Conditions are true then do actions
          • Conditions
            • (Item-Type of (Picked Item)) Equal to (Item-Type of Your_Item)
          • Actions
            • Then do
              • Item - Remove (picked item) from game
              • Else do
You can also check to make sure that the item is the closest item to the dying unit, in case there are other item-types matching your item.

Do item groups leak?

Also what does this item do? It is probably easiest to do something like:
  • Events
    • Unit - A unit activates an item
  • Conditions
    • Item type of Item being manipulated equal to (your consumable item)
  • Actions
    • Item - Remove Item being manipulated from the game
  • Actions
Not sure if that is exactly what you need. You could also check if the unit is dead.
 
Status
Not open for further replies.
Top