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

GUI - Attack Once & Auto-Attack

Status
Not open for further replies.
Level 9
Joined
May 9, 2009
Messages
536
When my unit attacks, I want him to only attack once. I dont want him to just keep attacking, but I want him to attack only once when ordered to attack via right-click or attack. I also dont want other unit auto-attacking back and both units have attacks. I need to find a way so that when one unit attacks, he attacks only once per order and I need to disable auto-attacking. I need to find a way to intercept the smarts of attack and the order attack to replace it with attack once. Answer will get lots of rep(Probably +4)
 
What about
  • Trigger1
  • Events
    • Unit - A unit is attacked
  • Conditions
  • Actions
    • Set Timer1 = (Last created timer)
    • Set Unit1 = (Attacking unit)
    • Set Unit2 = (Attacked unit)
    • Countdown Timer - Start Timer1 as a one-shot timer that will expire in 1.00 seconds
  • Trigger2
  • Events
    • Time - Timer1 expires
  • Conditions
  • Actions
    • Set Point1 = (Position of (Unit2))
    • Unit - Create 1 dummy at (Point1) for (Owner of (Unit1)) facing default building degrees
    • Unit - Order (Last created unit) to Human - Banish (Unit2)
    • Unit - Add a 2.00 second generic expiration timer to (Last created unit)
    • Custom script: call RemoveLocation (udg_Point1)
    • Custom script: call DestroyTimer (udg_Timer1)
    • Set Unit1 = No unit
    • Set Unit2 = No unit
 
Status
Not open for further replies.
Top