Advertisement
Guest User

Lock

a guest
Aug 25th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. local doorLocation = "side_goes_here"
  4. local password = "password_goes_here"
  5. local sleepTime = time_in_seconds
  6.  
  7. while true do
  8.  write("Enter the password: ")
  9.  input = read("*")
  10.  if input == password then
  11.         print("Password Correct!")
  12.         redstone.setOutput(doorLocation, true)
  13.         sleep(sleepTime)
  14.         redstone.setOutput(doorLocation, false)
  15.         term.clear()
  16.         term.setCursorPos(1,1)
  17.  else
  18.         print("Incorrect Password! Try again!")
  19.         sleep(sleepTime)
  20.         term.clear()
  21.         term.setCursorPos(1,1)
  22.  end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement