Advertisement
honeyphos1234

Password lock

Jun 23rd, 2015
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. password = 'password'
  2. term.clear()
  3. term.setCursorPos(1,1)
  4. term.setTextSize(1)
  5. term.write('Password: ')
  6. input = read("*")
  7.  
  8.  
  9. function reset()
  10.   term.clear()
  11.   os.reboot()
  12. end
  13.  
  14.  
  15. if input = password then
  16.   term.setTextColor(colors.green)
  17.   term.write('Access Granted! Enjoy')
  18.   redstoneOuput('right', true)
  19.   sleep(3)
  20.   redstoneOutput('right', false)
  21.   sleep(1)
  22.   reset()
  23. else
  24.   term.setTextColor(colors.red)
  25.   term.write("Access Denied! Goodbye")
  26.   term.setTextColor(colors.white)
  27.   sleep(3)
  28.   reset()
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement