Lladnar45

Server Room Access

Apr 20th, 2024 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  1. i = 0
  2. rs.setOutput("bottom", false)
  3. function openDoor()
  4.     rs.setOutput("right", true)
  5.     print("Access Granted")
  6.     os.sleep(10)
  7.     rs.setOutput("right", false)
  8.     i = 0
  9. end
  10. function emerEvac()
  11.     rs.setOutput("left", true)
  12.     os.sleep(5)
  13.     rs.setOutput("left", false)
  14.     return("Emergency Evacuation Activated... Please Stand By.")
  15. end
  16. function wrongPass()
  17.     if i == 0 then
  18.         i = 1
  19.         return "2 Attempts Remaining"
  20.     elseif i == 1 then
  21.         i = 2
  22.         return "1 Attempt Remaining"
  23.     elseif i == 2 then
  24.         i = 0
  25.         rs.setOutput("bottom", true)
  26.         return "INVALID AUTHORIZATION, BEGINNING SECTOR LOCKDOWN"
  27.     end
  28. end
  29. while true do
  30.     term.clear()
  31.     term.setCursorPos(1,1)
  32.     rs.setOutput("right", false)
  33.     poweredon = rs.getInput("back")
  34.     if poweredon == true then
  35.         openDoor()
  36.     else
  37.         os.sleep(.5)
  38.     end
  39.     print("Welcome to RFighter15's Server Room!")
  40.         print("Authorized Access Only")
  41.         input = read("-CEN-")
  42.         if input == "serverentry" then
  43.             openDoor()
  44.         elseif input == "emer" then
  45.             print(emerEvac())
  46.         else
  47.             print("Password Incorrect")
  48.             os.sleep(3)
  49.             print(wrongPass())
  50.             os.sleep(5)
  51.         end
  52. end
Add Comment
Please, Sign In to add comment