Advertisement
Protocol73

door_lock

Feb 22nd, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1. -- Uncomment line two to stop ppl from ( ctrl + t ) "Terminating" the Program
  2. --os.pullEvent = os.pullEventRaw
  3. --Edit the varables set on lines 5-8 to setup the lock.
  4.  
  5. local password = "changeme" -- Name program 'startup' to run at boot.
  6. local ot = 3 --(O)pen (T)ime in Seconds
  7. local side = "right left ect." --Set side of Redstone output
  8. user = "changeme" -- Change to your MC username
  9.  
  10.  
  11. while true do
  12.  term.clear()
  13.  term.setCursorPos(15,8)
  14.  write("Login Code:")
  15.  local input = read("*")
  16.   if input == password then
  17.   term.clear()
  18.   term.setCursorPos(19,8)
  19.   print("Access Granted")
  20.   sleep(1)
  21.   term.setCursorPos(15,10)
  22.   print("Welcome Back " ..user..".")
  23.   redstone.setOutput(side, true)
  24.   sleep(ot)
  25.   redstone.setOutput(side, false)
  26.   term.clear()
  27.   term.setCursorPos(1,1)
  28. else
  29.   term.clear()
  30.   term.setCursorPos(20,8)
  31.   textutils.slowPrint("Access Denied.",7)
  32.   term.setCursorPos(15,10)
  33.   textutils.slowPrint("Check Your Access Code.",8)
  34.   sleep(3)
  35.  end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement