Sarven Siege (JS) [SOLVED]

I got this error message: Unhandled error: Type error: Cannot read properties of undefined ('reading isVector') on Sarven Siege. The error occurs when I summon a griffin-rider, but there is no given line for the error. I don’t even know what it means. I’ll attach the code for the griffins:

const towers = hero.findByType("arrow-tower")
let i = 0;
...
if (hero.findEnemies().length) {
    if (hero.gold > hero.costOf("griffin-rider")) {
        hero.summon("griffin-rider");
        hero.command(hero.built[hero.built.length - 1], "defend", towers[i]);
        if (i < towers.length) {i = i + 1;}
        else {i = 0;}
    }
}

This might not be the portion of the code that has an error, but I think it is. What does the error mean? Is there a problem with my code that I just don’t see?

Please PM me the full code so that I can look at it (don’t post it here since it’s a solution)

Also, btw, to add 1 to a variable you can just do variable++ and if you want to use variable = variable + 1 then use variable += 1 instead

2 Likes

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.