Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Clash of Clones Help!


Hey everyone, I need help with my code in ClashOfClones level. My hero dies too fast. I have tried literally everything: I got the best sword, best shield with bash, then just shield and no sword, tried to attack the healthies enemy first, then just my Clone first, then just archers etc etc… I feel like I need some sort of boost or any hint. Here is my current code, which only deals w archers because my hero dies too fast anyway so why bother with other enemies:

function bashAttack(enemyWho) {
    if (enemyWho) {
        while ( > 0) {
            if (hero.isReady("bash")) {
            } else {
var archers = hero.findByType("archer", hero.findEnemies());
var archerIndex = 0;
while (archerIndex < archers.length) {
    var archer = archers[archerIndex];


Use a weak sword with a good shield. Also use chain lightning if you have the emperor’s gloves.


Chaboi, that’s what i’m using right now, the basic sword and the best shield in the game. I don’t have gloves though and no money to buy it, is there a way to pass the level without them?


Have you tried the level with flags? It makes it much easier to beat than a standard attack code.


Believe it or not, I did. My hero literally ignored it. I even copy-pasted just that code for flags from the “manual”, just couple lines of code, then I’m trying to place the flags - no reaction…


Your code should be something like

while (true){
    var flag=hero.findFlag()
    var enemy=hero.findNearestEnemy()
    if flag{
    else if enemy{
        //Attack code


Chaboi, thanks a ton here, I didn’t put the flag code in the while loop. I’ll try now with flags, as I understand yaks play a big role here.


Key is to cast invis and go behind enemy archers and kill all of them


Yeah it depends, if you have both chain lightning and invis, you can invis back and chain lightning the archers. :man_shrugging:


Hei Chaboi, thanks so much, I passed. Actually, the flags and yaks were helpful.


i am also stuck on this level but when i tried to un-equip my sword, it wouldn’t let me play. is there another way to win?


if i un-equip my sword, it won’t let me play.


Use boosts that your opponent doesn’t have, such as bash or chain-lightning.


if i do that, he can still use the sword. also, i don’t have chain lightning.


But bash comes from your shield, so you can use bash with a shield (there are some cheap bash shields) and attack with your sword.
I would also recommend quickly attacking the archers at the start.
:lion: :lion: :lion:


i tried that but the enemy just attacked them with a sword


It’s because the enemy can use attack().


so how do i stop them from attacking?


You can’t. (20 characters)


then can i prevent the clone of me from attacking?