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

[Solved] Keeping Time

#23

Sword of the temple guard’s attack cooldown is 0.26 seconds, but Morning’s edge has a cooldown of 0.25, so the morning’s edge is slightly faster.

#24

@Chaboi_3000 I said the hero can only attack 4 times per second. That’s even more correct with the morning edge.

#26

This is not working. It says that there is a function instead of a unit for the attacking at first

#27

We can’t really help unless you post your code. Don’t forget to use the </> button so it formats correctly.

#28

I fixed it because all there was was an extra enemy = hero.findnearestEnemy.

#29

an extra enemy=hero.findNearestEnemy() shouldn’t cause a problem

#30

It did because I put it in an if statement when I had one right outside of the statement.

#31

This code isnt workingwhile True: # If it's the first 10 seconds, attack. if hero.time < 10: enemy = hero.findNearestEnemy() hero.attack(enemy) pass # 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) pass # After 35 seconds, attack again! else: hero.attack(enemy)

#32

Could you start a new line then paste your code?