hi, could somone explain why i’m getting this error?
it says hero placeholder cant command type “peasant”. But im not commanding a peasant, im commanding a soldier.
# If the peasant is damaged, the flowers will shrink!
def summonSoldiers():
if hero.gold >= hero.costOf("soldier"):
hero.summon("soldier")
# Define the function: commandSoldiers
def commandSoldiers():
for soldier in hero.findFriends():
enemy = hero.findNearestEnemy()
if enemy:
hero.command(soldier, "attack", enemy)
# Define the function: pickUpNearestCoin
def pickUpNearestCoin():
items = hero.findItems()
nearestCoin = hero.findNearestItem()
if nearestCoin:
hero.move(nearestCoin.pos)
while True:
summonSoldiers()
commandSoldiers()
pickUpNearestCoin()
@Psyko2k You are always able to make a new topic if you need help so really there is no need for this one once you have solved it. I do appreciate that you want to keep this open but others may have already clicked on this topic and then off which means that only people that have not been on or @Eric_Tang will see this so do please check the tik box and make a new one if necessary thanks.