I read somewhere that you should write not
startThread( "replacecreature" )
but
startThread( replacecreature)
I tried this option too, but it didn't work either.
Did you take into account the subtraction of archers?
Well, and please provide what the console writes. How to enable it is in the FAQ.
I fixed the code. I also missed a sleep command, what a klutz.