Skip to content
User Avatar
#2834
Auto-translated
Here is the code:
function DefenderCreatureDeath(unit)
	if(GetCreatureType(unit) == 21) then
		removeUnit("CREATURE_DEVIL")
		SummonCreature(DEFENDER,137,10,-1,-1)
	end
	if(GetCreatureType(unit) == 27) then
		removeUnit("CREATURE_SUCCUBUS")
		SummonCreature(DEFENDER,134,10,-1,-1)
	end
end

local units = GetCreatures(DEFENDER);
for i, unit in units do
  local unit_id = GetCreatureType(unit);
  if(unit_id == 27) then
    removeUnit(unit)
  end
end

local units = GetCreatures(DEFENDER);
for i, unit in units do
  local unit_id = GetCreatureType(unit);
  if(unit_id == 21) then
    removeUnit(unit)
  end
end
Here is the error: And this is not just in this battle. And yes, nothing happens as intended. Apparently, I need to somehow get the hero's name...
Автор карт:
Долина расхитителей
Выбор мира

Statistics

Welcome our newest member: artem

Users Online 2 users 1456 guests