I need help with lvl 47 cs3 keeping time

this is my code , my guy just stands still

while True:
# If it’s the first 10 seconds, attack.
if hero.time < 10:
if enemy:
enemy = hero.findNearestEnemy
hero.attack(enemy)
pass
# Else, if it’s the first 35 seconds, collect coins.
elif hero.time < 35:
if coin:
coin = hero.findNearestItem()
hero.moveXY(coin.pos.x, coin.pos.y)
pass
# After 35 seconds, attack again!
else:
enemy = hero.findNearestEnemy()
if enemy:
hero.attack(enemy)

someone heeeelp cuz i need this in 2 days

@jonthebrick, please format your code correctly using this button:
format code
Is computer science for schools? cuz I haven’t seen it on coco.

1 Like

But I can probably help you if you format it right. :slightly_smiling_face:

yep it is only for schools

Try adding a () after the hero.findNearestEnemy. :slight_smile:

3 Likes