sorry there is too much code here for me to determine where the problem may lie, especially since you can't really see the line numbers like you do in the editor. I would suggest find the relevant line (likely one of the 3 createCreep lines) and remove/alter them temporarely and see if the problem goes away. If it does keep removing/tweaking it until the problem goes away. There is a good chance some of the special characters like ( or . are some wierd unicode version that looks fine to you but the computer doesn't like. try re-typing the commands or copy/paste into console to see your results. one quick thing i've spotted off topic: var tower = Game.getObjectById('136f5028c6fc960974e187ef'); replace with something like var tower = creep.pos.findClosestByPath(FIND_STRUCTURES, {filter: (structure) => { return (structure.structureType == STRUCTURE_TOWER) } }); hardcoded object ids are bad, especially if you respawn