Advertisement
McBaron

lock

Aug 9th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw -- prevents to Terminate
  2. local side = "right" -- The side your door is placed on (left or right)
  3. local password = "pass" -- The password you want ::WARNING:: The password is case sensetive.
  4. local opentime = 5 -- How long the door will be open (secounds)
  5. while true do
  6.  term.clear()
  7.  term.setCursorPos(1,1)
  8.  write("Password: ") -- Computer asks you about the password
  9.  local input = read("*")
  10.  if input == password then
  11.   term.clear()
  12.   term.setCursorPos(1,1)
  13.   print("Access Granted")
  14.   rs.setOutput(side,true)
  15.   sleep(opentime)
  16.   rs.setOutput(side,false)
  17.  else
  18.   print("Access Denied") -- If you type in the wrong password, you will get access denied.
  19.   sleep(2)
  20.  end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement