I know there is a trigger that kills or remove summoned unit, but in my case its not working...i dont know why
i was making an ability where it summons a unit and after casting that summon ability, it changes into different ability using trigger, making the summoned unit exist, but i want when casting the second ability removes that unit after casting even if there is still duration left
ex: summon ward > summons unit > has 30 sec duration > ability changes to thunderclap after casting via trigger > cast thunderclap to remove unit (doesnt work, dunno why)
There is no 'trigger' to kill or remove summoned units.
But there's multiple Actions that can kill units in general:
-
Actions
-

Unit - Kill (Any unit)
-

Unit - Remove (Any unit) from the game <-- Skips the 'A unit Dies' event
-

Unit - Deal 999999.00 damage to (Any unit)...
-

Unit - Add a 5.00 second Generic expiration timer to (Any unit)
I say this just for the sake of clarity.
More importantly, the solution you want will depend. You have to answer these questions:
1) How many units will be able to have this summon ability?
2) If more than one unit, how many can exist on the map at any given moment?
3) If more than one unit can exist, is it limited to 1 per Player?
Assuming you said 'yes' to #3, you can use an MPI solution, meaning you're going to make this work for one caster per player:
-
Events
-

Unit - A unit Spawns a summoned unit
-
Conditions
-

(Unit-type of (Summoned unit)) Equal to YOUR SUMMON
-
Actions
-

Set Variable PN = (Player number of (Owner of (Triggering unit))
-

Set Variable Summoned_Unit[PN] = (Summoned unit)
^ Note that if you manually create the summoned unit then you can skip this trigger and simply Set Summoned_Unit to be the (Last created unit) instead.
-
Events
-

Unit - A unit Starts the effect of an ability
-
Conditions
-

(Ability being cast) Equal to YOUR OTHER ABILITY
-
Actions
-

Set Variable PN = (Player number of (Owner of (Triggering unit))
-

Unit - Kill Summoned_Unit[PN]
^ Summoned_Unit is a
Unit array variable. PN is an
Integer variable.
If you want any number of units to use these abilities without issues then you will need an MUI solution. I recommend Unit Indexing (link in my signature). The above two triggers could be reused, but you would set PN's value to the (Custom value of (Triggering unit)) instead.