Advertisement
Samotage820

cc door terminal

Aug 13th, 2022 (edited)
964
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. local pullEventBackup = os.pullEvent
  2. os.pullEvent = os.pullEventRaw
  3.  
  4. local function reset()
  5.     term.clear()
  6.     term.setCursorPos(1,1)
  7.     term.setTextColor(colors.lightGray)
  8.     print("-- SECURITY TERMINAL A5 --\n")
  9.     term.setTextColor(colors.white)
  10.     print("Please enter password:")
  11. end
  12.  
  13. while true do
  14.     reset()
  15.     local input = read("*")
  16.  
  17.     if input == "admin" then
  18.         textutils.slowPrint("Access granted.")
  19.         os.pullEvent = pullEventBackup
  20.         redstone.setOutput("back", true)
  21.         sleep(2)
  22.         redstone.setOutput("back", false)
  23.         sleep(10)
  24.     else
  25.         textutils.slowPrint("Access denied.")
  26.         sleep(2)
  27.     end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement