• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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