Auto-translated
I don't know what the problem is anymore. I tried a simple script to summon creatures in a number equal to level * 2 – it seems to work, everything looks correct, but nothing happens.
function Start()
lev = GetGameVar("level") + 0;
mana = GetUnitManaPoints(GetAttackerHero())
SetUnitManaPoints(GetAttackerHero(), 100);
repeat sleep() until(GetUnitManaPoints(GetAttackerHero()) == 100);
if lev < 10 then
startThread(UnitCastGlobalSpell, GetAttackerHero(), 212);
elseif lev < 20 then
startThread(UnitCastGlobalSpell, GetAttackerHero(), 212);
startThread(UnitCastGlobalSpell, GetAttackerHero(), 215);
elseif lev < 30 then
startThread(UnitCastGlobalSpell, GetAttackerHero(), 212);
startThread(UnitCastGlobalSpell, GetAttackerHero(), 215);
startThread(UnitCastGlobalSpell, GetAttackerHero(), 210);
else
startThread(UnitCastGlobalSpell, GetAttackerHero(), 212);
startThread(UnitCastGlobalSpell, GetAttackerHero(), 215);
startThread(UnitCastGlobalSpell, GetAttackerHero(), 210);
startThread(UnitCastGlobalSpell, GetAttackerHero(), 213);
end
sleep(2);
SetUnitManaPoints(GetAttackerHero(), mana);
end