Guest User

Untitled

a guest
Jan 20th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. while true do
  2.  
  3. term.clear()
  4.  
  5. term.setCursorPos(1, 1)
  6.  
  7. local user
  8. term.write("Enter a username: ")
  9. user = read()
  10.  
  11. local password1
  12. term.write("Enter a password: ")
  13. password1 = read()
  14.  
  15. redstone.setOutput( "left", true)
  16. term.clear()
  17. term.setCursorPos(1, 1)
  18. print("Closing the door in 5 seconds")
  19. sleep(5)
  20. redstone.setOutput( "left", false)
  21.  
  22. term.clear()
  23. term.setCursorPos(1, 1)
  24.  
  25. local password2
  26. print("Enter your password to open the door: ")
  27. password2 = read()
  28.  
  29. while password1 ~= password2 do
  30.   print("wrong password.")
  31.   sleep(1)
  32.   term.clear()
  33.   term.setCursorPos(1, 1)  
  34.   print("Enter your password to open the door: ")
  35.   password2 = read()
  36. end
  37.  
  38. if password1==password2 then
  39.   print("Correct.")
  40.   redstone.setOutput("left", true)
  41.   sleep(5)
  42.   redstone.setOutput("left", false)
  43. end
  44.  
  45. end
Add Comment
Please, Sign In to add comment