Skip to content
#2983
Auto-translated
Guys, I need some help:
How can I make it so that when a hero enters a region, the number of all their creatures is reduced by half? Thanks in advance.

The simplest solution is to apply something like this to the region:
for slot = 0, 6 do
local creature, count = GetObjectArmySlotCreature(hero, slot)
if not (creature == 0 or count == 0) then
RemoveHeroCreatures(hero, creature, count/2)
end
end

Statistics

Welcome our newest member: dodoD0D0