• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Trigger] How to make this simply GUI MUI

Status
Not open for further replies.
Event: A unit starts casting an ability
Condition: Abilty being cast equal to Plagued Brain
Action:
-----Do some action with target unit of ability being cast-----
wait 5 seconds
-----Do some action with target unit of ability being cast-----

Because of the target unit of ability being cast is null after 5 seconds, it does not work corretly. Can anyone help me please?
 
  • Custom script: local unit udg_Tmp_Unit = GetSpellTargetUnit()
  • Custom script: local integer udg_Tmp_Integer = ( 5 + GetUnitAbilityLevelSwapped('A00O', GetTriggerUnit()) )
    • For each (Integer A) from 1 to Tmp_Integer, do (Actions)
      • Loop - Actions
        • Wait 1.00 game-time seconds
        • Unit - Cause (Triggering unit) to damage Tmp_Unit, dealing (12.50 + ((Real((Level of Weakening Epidemic for (Triggering unit)))) x 2.50)) damage of attack type spells and damage type magic
        • Set Tmp_Loc = (Position of Tmp_Unit)
        • Specialeffect - Create a special effect at Tmp_Loc using Abilities\Spells\Other\Volcano\VolcanoMissile.mdl
        • Custom script: call RemoveLocation(udg_Tmp_Loc)
        • Set Tmp_Effect = (Last created special effect)
        • Specialeffect - Destroy Tmp_Effect
    • Custom script: set udg_Tmp_Unit = null
    • Custom script: set udg_Tmp_Integer = 0
And whats wrong with this?
 
Your trigger has no problems.

It could be coded better though.

You do not need to use the Special Effect variable. Simply create and destroy it in the following line (last created special effect).
You do not need to set the integer to 0 as it is a local.

A local variable loses its value when its function ends.
 
Status
Not open for further replies.
Back
Top