Auto-translated
You don't need to create a separate thread; there's a special trigger for when a hero is lost – PLAYER_REMOVE_HERO_TRIGGER.
There was also a function that automatically made a hero reappear in the tavern after death – MakeHeroReturnToTavernAfterDeath.
If you need the hero to reappear on the map, you need to place the hero in reserve (in the editor, in the map settings) and then remove him from reserve at the beginning of the map and each time after he dies – DeployReserveHero.
There was also a function that automatically made a hero reappear in the tavern after death – MakeHeroReturnToTavernAfterDeath.
If you need the hero to reappear on the map, you need to place the hero in reserve (in the editor, in the map settings) and then remove him from reserve at the beginning of the map and each time after he dies – DeployReserveHero.