while true do
print ("Enter pass:")
read("*")
if answer == "loopycoopy" then
print ("Please enter")
rs.setOutput("left", true)
sleep(3)
rs.setOutput("left", true)
os.reboot()
else
print ("Enter Pass Two")
print ("Enter Pass:")
read ("*")
if answer == "Admin" then
print ("Please enter")
rs.setOutput("right", true)
sleep(3)
rs.setOutput("right", true)
os.reboot()
else
print ("You may NOT enter")
sleep(1)
os.reboot()When i use this code it says there is an = needed at one of the else's and i don't know why. I want to use this in a pack of programs i'm planning to put here. Anyway, could someone help me fix this code? i took out the second password and it worked fine, so it must be either that or the fact that something won't allow two else's. I have no idea at all. I also tried to put an end at the end (go figure) but now it wants me to put an = there too.(And yes, i picked loopycoopy as my password :P/>)
EDIT: I think it is solved, here is my code now:
while true do
print ("Enter pass:")
answer = read("*")
if answer == "loopycoopy" then
print ("Please enter")
rs.setOutput("left", true)
sleep(3)
rs.setOutput("left", true)
os.reboot()
else
print ("Enter Pass Two")
print ("Enter Pass:")
answer = read ("*")
if answer == "Admin" then
print ("Please enter")
rs.setOutput("right", true)
sleep(3)
rs.setOutput("right", true)
os.reboot()
else
print ("You may NOT enter")
sleep(1)
os.reboot()
end
end
end
end
endI think that it is fixed now, thanks to;TheOriginalBIT
for helping me.