It is attacking the burl because “type burl” isn’t checking to see if it is a burl or not. Could you post the complete code with formating again so I can take a look and see if it is an indenting problem?
Too bad it 00:10 am here , really want to help but have to sleep , so here some suggestion
combine your first code with the 2nd one , you have removed enemy.type so make it back but don’t forget to keep enemy = findnearsttenemy ,
enemy.type is "burl":
perhaps?
the ‘is’ needs to be in there.
the third level on the second map
enemy = self.findNearestEnemy()
if enemy.type is "burl":
self.say("I'm not attacking that Burl!")
if "type munchkin":
self.attack(enemy)
if "type thrower":
self.attack(enemy)
if "type ogre":
self.moveXY(41, 37)
Help pease it still isn’t working and I don’t understand
what you guys want me to do
OK, you changed the “type burl” thing to
if enemy.type is "burl":
which is good… change the others as well
it is just putting an red x under my character but not donig any thing or saying what is wrong my cod I have so far is:
enemy = self.findNearestEnemy()
if enemy.type is "burl":
self.say('I am not attacking that Burl!')
if enemy.type is "munchkin":
self.attack(enemy
if enemy.type is "thrower":
self.attack(enemy)
if enemy.type is 'ogre':
self.moveXY(41, 37)
Ok… is your loop in there somewhere?
no where do I put it
Loops generally go in the beginning of your code… so try:
loop:
enemy = self.findNearestEnemy()
THE-REST-OF-YOUR-CODE-GOES-HERE
does the rest of my code have to have four spaces infront of it
You will have to watch the tabs carefully here, and I don’t want that to trip you up so it should look something like this:
loop:
enemy = self.findNearestEnemy()
if enemy.type is "burl":
self.say('I am not attacking that Burl!')
if enemy.type is "munchkin":
self.attack(enemy
if enemy.type is "thrower":
self.attack(enemy)
if enemy.type is 'ogre':
self.moveXY(41, 37)
it worked tank you sooooooooooooooooooooooooooooooooooooooo much you are my hero =) =0 thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you
I ran your code successfuly after fixing a small parenthesis error. I would recommend going back and reviewing loops and if/else statements before continuing. They are used a whole lot.
Good luck! It was no trouble. If you need anything else post it up, but I am off for the evening. G’night!
Thank you!
lol…
loop:
self.say("You're welcome")
Hey guys. I think this is a glitch. When I press,
if (enemy.type == "thrower") {
this.attack(enemy);
}
It won’t attack the archers. Is it a glich or no.]
Thx,