function FightUnitExp(hero, unit)
while IsObjectExists(hero) == not nil and IsObjectExists(unit) == not nil do
sleep(5)
end
if IsObjectExists(unit) == nil then
ChangeHeroStat(hero, 0, 999999999)
end
end
Trigger(OBJECT_TOUCH_TRIGGER, "UnitExp", "FightUnitExp")
and check it in the game.