First problem is that you never declare
time variable:
input = time --// Because time is never set to anything your are just setting input to nil
...
sleep(time) --// Sleep requires a number and time is not a number, it is nil
Also, you placed too much
end's in a wrong place:
print("Goodbye!")
os.shutdown()
end --// This end shouldn't be here
end --// This end shouldn't be here too
else
print ("Password: Bad, locking for 15 sec.")
--// They should be here:
print ("Password: Bad, locking for 15 sec.")
sleep(15)
os.reboot()
end --// Here
end --// And here
To see if you putted your
ends correctly you should indent your code:
Not indented code
local function clear ()
term.clear()
end
for i = 1, 10 do
print(i)
end
x = 20
while x > 10 do
if x > 15 then
x = x - 1.5
else
x = x - 1
end
end
Indented code
local function clear ()
term.clear()
end
for i = 1, 10 do
print(i)
end
x = 20
while x > 10 do
if x > 15 then
x = x - 1.5
else
x = x - 1
end
end
As you can see, when we indent the code it is easier to see all the
ends and where all blocks start and end.