• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

How to remove Unit for owning player from player group

Status
Not open for further replies.
Since I don't know how you are supposed to hire heroes in your map (be it with trigger creation or selling event) and guessing that one hero is used per player, I'll use this:
  • Trigger
  • Events
    • Unit - A unit enters (Playable Map Area)
  • Conditions
    • ((Triggering unit) is a Hero) Equal to True
    • ((Triggering unit) is in HeroGroup) Equal to False
  • Actions
    • Unit Group - Add (Triggering unit) to HeroGroup
    • Set Hero[(Player number of (Triggering player))] = (Triggering unit)
  • Trigger1
  • Events
    • Unit - A unit dies
  • Conditions
    • (Triggering unit) Equal to Hero[(Player number of (Triggering player))]
  • Actions
    • Player Group - Remove (Triggering player) from YourForce
Variables used:

i) HeroGroup: Unit Group
ii) Hero[]: Unit, array ticked
iii) YourForce: Player Group, the one you want the owner of the unit to be removed from.
 
Status
Not open for further replies.
Top