What happens when you run the code? Do you get an error? Does your hero just do nothing? Please provide a description of what happens.
You’re code looks okay but it’s hard to tell because you didn’t post it properly. Please learn to properly post your code from the game from now on using the </> button or it won’t format properly. When you click the </> button, the following will appear:
There are many people here willing and able to help. If you use the </> button correctly, your code should look like this:
enemy = hero.findNearestEnemy()
hero.say("My code is formatted properly")
If it doesn’t look like the code above then you’re doing it wrong and we can’t see the structure of the code to troubleshoot whether or not that is the issue. Use the </> button and help us help you. This works when sending a private message as well. Thank you.