Auto-translated
No, the error "attempt to call a nil value" means that you are trying to call an unknown function for the game. The game doesn't recognize the function named 'GetUntiManaPoints', which is why it's throwing an error.
Do you want to make it so that at the beginning of the battle, Ice Shards are cast on all enemies? Then the script needs to be changed like this:
function Start()
if GetHeroName(GetAttackerHero()) == 'Raelag' then
print("if the main character is the attacker");
local mana = GetUnitManaPoints(GetAttackerHero()) --Otherwise, we'll leave the player with 200 mana for no reason!
SetUnitManaPoints(GetAttackerHero(), 200);
repeat sleep(1) until GetUnitManaPoints(GetAttackerHero())==200 --Sleep until the mana is added
for i, creature in GetDefenderCreatures() do
startThread(UnitCastAimedSpell, GetAttackerHero(), 4, creature)
end
SetUnitManaPoints(GetAttackerHero(), mana); --Return the mana to the amount it was!
print("casting");
elseif GetHeroName(GetDefenderHero()) == 'Raelag' then
print("if the main character is the attacker");
local mana = GetUnitManaPoints(GetDefenderHero()) --Otherwise, we'll leave the player with 200 mana for no reason!
SetUnitManaPoints(GetDefenderHero(), 200);
repeat sleep(1) until GetUnitManaPoints(GetDefenderHero())==200 --Sleep until the mana is added
for i, creature in GetAttackerCreatures() do
startThread(UnitCastAimedSpell, GetDefenderHero(), 4, creature)
end
SetUnitManaPoints(GetDefenderHero(), mana); --Return the mana to the amount it was!
print("casting");
end;
end