[SOLVED] The Final Kithmaze Code Combat


Hi i,am Bejamin my age is 8 years old
and i,am stuck here

i,am stuck at the last kithhof i,am using this code…

( while true do
enemy = hero:findNearestEnemy()

and it does not work i tried every thing and i just get the same code problem
i am working on this 5 days and it does not work :rage::smiley::smiley::smiley:

thanks 4 the help


You must define variable enemy.

local enemy = hero:findNearestEnemy()


man it does not work i,am using this code

code while true do
local enemy = hero:findNearestEnemy()
help me man


Did you try the if statement. Sometimes there is no enemy and enemy is null so the code fails


there are 3 enemies man:smiley:


What level is this on? I want to test this out. There is no level called the last kithof in the game.


its in the first dungeon man


I know. Kithgard Dunegon is the World Name. I want the Level Name

(Example: Dungeons of Kithgard)


the last kithhof man


The level is called The Final Kithmaze FYI.

Now to the code itself, your code is 100% correct so far.

After you attack, but still inside the loop, you need add a couple of move commands.

(I’ll give you a hint. After you attack, you must have three more move commands. Try a combination of moveDown and moveUp and eventually you’ll get the solution (do not try moveRight or moveLeft)). This should be a big enough hint but if you still need help, tell me man. :wink:


can you give me the good code man:sunglasses:


thanks man love it :smiley:


Bro, you cant ask for the code. This is supposed to be a learning game, and the point is to find the answer. BTW, I accedentally did the same thing once, so your not the only one.


True, but the code I gave him was just a little help. He didn’t understand what I meant by a combination of move commands so I showed him. I think for these earlier levels, its ok to show them an example to help them grasp the concept. Its never OK to give out code, but I think a little hint like that follows the guidleines. :smiley:


I was not talking about you @_TD_RodYT but @Benjamin_van_den_Bra


Ok Thanks I was confused. (20 Characters)


sorry :grin:


It is not that hard (20 characters)


this is the code that i used that made it work

(solution removed)



Please don’t post solutions here. You will find this stated in many threads throughout this board. The purpose of Code Combat is to learn and force people to think. Simply providing the answers is not helpful and counter productive to the learning process. Please delete your post. Thanks.