Erwd2

DoorLock(Lua)

Apr 4th, 2022
1,151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. while true do
  4.   term.clear()
  5.   term.setCursorPos(1, 1)
  6.   print("Enter your password, please!")
  7.   write("Password: ")
  8.   pwd = read("*")
  9.   if pwd == "password" then
  10.     print("Live granted.")
  11.     rs.setOutput("left", true)
  12.     sleep(3)
  13.     rs.setOutput("left", false)
  14.   if pwd == "kill" then
  15.     print("Death granted.")
  16.     rs.setOutput("right", true)
  17.     sleep(2)
  18.     rs.setOutput("right", false)
  19.   else
  20.     print("Access denied.")
  21.     sleep(2)
  22.   end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment