Advertisement
Guest User

Untitled

a guest
May 30th, 2013
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. local side = "left" -- Change this if you want to have to door/wire on a different side
  2. local password = "Password" -- Change this to your preferred password
  3. local input = ""
  4.  
  5. term.clear()
  6. term.setCursorPos(1, 1)
  7. term.write("Password: ")
  8. input = read("*")   -- The asterisk will replace any character that the user type,
  9.                     -- so passwords look realistic, if you dont want that, just
  10.                     -- delete the asterisk
  11.  
  12. term.clear()
  13. term.setCursorPos(1, 1)
  14.  
  15. if input == password then
  16.     term.write("Access Granted") -- Change to your personalised message
  17.     redstone.setOutput(side, true)
  18.     sleep(5) -- Time that the door will remain open
  19.     redstone.setOutput(side, false)
  20.     os.shutdown() -- Computer will shutdown until next user wants to access
  21. else
  22.     term.write("Access Denied")
  23.     sleep(3)
  24.     os.shutdown()
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement