This definetly isnt the best way to do it. If you would set it so Events: Unit dies. Conditions: Unit type equal to *unit type*. Actions: 1.Wait *amount of time until respawn*. 2.Replace triggering unit with *unit type* using new units default health and mana. This would be more effective as you can use the corpse and your hero earns exp.
This Système allow you to detect when a unit is Reincarned . It's based on the event : An unit Use an item . - Don't Forget to modify the ability ( Objet - reincarnation and Inventory ) - You can't Get the Killing Unit . - You can't use the Corpse . - Your hero doesn't earn exp :-( But the repsawned unit keeps the same handle as the dying unit ( Hero manipulating ) .
- All globals variable are useless . It was just to make it obvious