Connection ErrorBad RequestThis page went staleSession ExpiredSign in requiredForbiddenNot FoundToo Many RequestsServer ErrorBad GatewayService UnavailableGateway TimeoutHTTP Version Not Supported
Session Expired
Your session has expired. Please log in to continue.
Sign in required
You need an account to do that. Sign in or create one — it only takes a minute.
This page went stale
Your security token was rejected, usually because the page sat open too long or you signed in elsewhere. Nothing was saved. Reload the page and try again.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
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