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

Can't kill your own units

Status
Not open for further replies.
Level 4
Joined
Jan 17, 2018
Messages
112
Hi,

How do I make it so that you can't attack your own units? I'm sure it has something to do with "targets allowed" but I don't know which option it is, unless it's a trigger I need?
 
Level 12
Joined
Dec 11, 2014
Messages
662
Yes, typed it over the phone, didn't check it before sending. Oops
Here it is:
  • AntiTK
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Owner of (Attacking unit)) is an ally of (Owner of (Attacked unit))) Equal to True
    • Actions
      • Unit - Order (Attacking unit) to Stop
 
Level 4
Joined
Jan 17, 2018
Messages
112
Yes, typed it over the phone, didn't check it before sending. Oops
Here it is:
  • AntiTK
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Owner of (Attacking unit)) is an ally of (Owner of (Attacked unit))) Equal to True
    • Actions
      • Unit - Order (Attacking unit) to Stop

Thanks, I'll try it later, but just a question: Unit - A unit Is attacked, so does this register before you attack? It looks like a script that Attacks-> Now stop attacking the unit.
 
Status
Not open for further replies.
Top