NoxiaZ

Home login

Oct 1st, 2013
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. orginalPassword = "Turbo"
  2. openDoor = colors.orange
  3. closeBehind = colors.red
  4. openGround = colors.white
  5.  
  6. while true do
  7.     term.clear()
  8.     term.setCursorPos(1,1)
  9.     print("--------------------------------")
  10.     print("---      NoxiaZ Security     ---")
  11.     print("--------------------------------")
  12.     print("")
  13.     print("Commands:")
  14.     print("Press O for open the door")
  15.     print("Press C for close the door")
  16.     local event = {os.pullEvent()} 
  17.     if (event[2] == "o") then
  18.         redstone.setBundledOutput("back", closeBehind)
  19.         write("Type in the code: ")
  20.         password = read()
  21.         if (orginalPassword == password) then
  22.             redstone.setBundledOutput("back", openDoor)
  23.         else
  24.             redstone.setBundledOutput("back", openGround + closeBehind)
  25.             sleep(1)
  26.             redstone.setBundledOutput("back",0)
  27.         end
  28.     elseif (event[2]=="c") then
  29.         redstone.setBundledOutput("back",0)
  30.     end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment