Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- local user
- term.write("Enter a username: ")
- user = read()
- local password1
- term.write("Enter a password: ")
- password1 = read()
- redstone.setOutput( "left", true)
- term.clear()
- term.setCursorPos(1, 1)
- print("Closing the door in 5 seconds")
- sleep(5)
- redstone.setOutput( "left", false)
- term.clear()
- term.setCursorPos(1, 1)
- local password2
- print("Enter your password to open the door: ")
- password2 = read()
- while password1 ~= password2 do
- print("wrong password.")
- sleep(1)
- term.clear()
- term.setCursorPos(1, 1)
- print("Enter your password to open the door: ")
- password2 = read()
- end
- if password1==password2 then
- print("Correct.")
- redstone.setOutput("left", true)
- sleep(5)
- redstone.setOutput("left", false)
- end
- end
Add Comment
Please, Sign In to add comment