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

[JASS] Change Owner, when HP is low

Status
Not open for further replies.
Level 1
Joined
Apr 17, 2006
Messages
1
I need this code:
Unit attacks one type of BUILDING, and when this building have less than X% HP, it change owner to attacker. I need code that will change owner of not specified bulding just of one type, like Tower.
Thx for help.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
this should probably be in maps, but w/e

Events
Unit - A Unit Is Attacked
Conditions
Unit Type of Triggering Unit Equal to *Tower, or w/e*
Percent Life of Triggering Unit less than *percent*
Actions
Unit - Change owner of Triggering Unit to Owner of Attacking Unit, and Change Color
Unit - Set Percent Life of Triggering Unit to 100%
 
Level 5
Joined
May 9, 2006
Messages
162
Prepare fire extunguishers, I'm going to flame!
Another n000000000b comes to forums (JASS forums, even not Maps) without even trying to write triggers and learn. I'm wondering: are all of our visitors such stupid?
 
Status
Not open for further replies.
Top