You have quite a few extra end's, you only need an end when you want to end an if statement or loop entirely
while true do
input = read("*")
if input == password then
--do correct password stuff
elseif input == "backdoor" then
--do backdoor stuff
else
--do wrong password stuff
end
end
Notice how every time the indentation go a level down, there is an end. There is no end before the else and elseif statment because they are part of the if statement, they build onto it.
Also note how the elseif comes before the else, this is because if the else was before, the computer would check to see if the input is the same as the password and if not then it would check the the next statement, if this statment is an else it would do that code and be done, but if it is an elseif it would check that code and then continue depending on the statment.
Generaly if statments go as follows,
first an if, any amount of elseif's (0 is an amount), optionally an else, an end
A more detailed version of the previous would be as follows
first an if, a condition and a then, any amount of elseif's, a condition and a then (0 is an amount), optionally an else, an end
I don't know if that made sense just ask if it didn't. :)/>