# Needing help for Level 47 Keeping time CS3

**URL:** <https://discourse.codecombat.com/t/needing-help-for-level-47-keeping-time-cs3/35067>\
**Category:** Level Help\
**Created:** [March 7, 2023, 7:16am UTC](https://discourse.codecombat.com/t/needing-help-for-level-47-keeping-time-cs3/35067 "2023-03-07T07:16:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Omar\_Siddiqui](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/omar_siddiqui/32/33694_2.png) [@Omar\_Siddiqui](https://discourse.codecombat.com/u/Omar_Siddiqui)\
**Post date:** [March 7, 2023, 7:16am UTC](https://discourse.codecombat.com/t/needing-help-for-level-47-keeping-time-cs3/35067/1 "2023-03-07T07:16:17Z")

</div>

# Use your new skill to choose what to do: hero.time

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

My code seems to be correct, used all the characters but they all just die at last second. Anyone know how to fix this?
