Astronomic_pancake

Computor Craft door lock

Jan 18th, 2021 (edited)
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.40 KB | None | 0 0
  1. local side = "right"
  2. local password = "password"
  3. local opentime = 5
  4. while true do
  5. term.clear()
  6. term.setCursorPos(1,1)
  7. write("Password:")
  8. local input = read("*")
  9. if input == password then
  10.     term.clear()
  11.     term.setCursorPos(1,1)
  12.     print("Correct Password")
  13.     redstone.setOutput(side, true)
  14.     sleep(opentime)
  15.     redstone.setOutput(side, false)
  16. else
  17. print("Password Incorrect!")
  18. sleep(3)
  19. end
  20. end
  21.  
Add Comment
Please, Sign In to add comment