Posted 30 December 2012 - 06:25 AM
So this is my code. Of course there is an almost identical piece of code above this, and that likely has the same problem.
Thing is, it asks wether or not you want to turn the defences on, and it lets you enter the password should you choose yes, but after you have entered the password the program just restarts - the code begins again from the first line.
I have no idea what I am doing wrong here, I have no experience in LUA (a bit of Java experience is all I've got) and the whole "ending an if-statement with an end-statement" thing that LUA has going on is pretty foreign to me. There are a total of 5 if-statements in the whole code, and that's pretty confusing to me (as I'm used to starting and stopping if-statements with brackets)
EDIT: I am uploading a video as we speak, showing all of the code and exactly what is going on when I execute it.
http://www.youtube.com/watch?v=KHiN4aHUD3Q
This is a video of the code and what happens when I excecute it.
Thing is, it asks wether or not you want to turn the defences on, and it lets you enter the password should you choose yes, but after you have entered the password the program just restarts - the code begins again from the first line.
I have no idea what I am doing wrong here, I have no experience in LUA (a bit of Java experience is all I've got) and the whole "ending an if-statement with an end-statement" thing that LUA has going on is pretty foreign to me. There are a total of 5 if-statements in the whole code, and that's pretty confusing to me (as I'm used to starting and stopping if-statements with brackets)
EDIT: I am uploading a video as we speak, showing all of the code and exactly what is going on when I execute it.
http://www.youtube.com/watch?v=KHiN4aHUD3Q
This is a video of the code and what happens when I excecute it.