Posted 23 February 2012 - 11:45 AM
Hello all, i was using a code for a simple door lock, and was wondering why the door wont close after the time limit?
Spoiler
local function clearScreen()
term.clear()
term.setCursorPos(1, 1)
end
while true do
clearScreen()
print ("Type password to enter:")
if read("*") == "asdf" then
clearScreen()
print("Correct Password!")
print("Open door for how long?")
local a = read()
clearScreen()
print("Opening door!")
sleep (1)
redstone.setOutput("left", true)
clearScreen()
sleep (a)
else
clearScreen()
print("Incorrect Password, please try again.")
sleep (5)
end
end