Advertisement
Cardwell

VaultDoor

Apr 20th, 2021 (edited)
973
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. --VaultDoor
  2. local pw = "bacon"
  3. local opentime = 5
  4. rednet.open("back")
  5.  
  6. while true do
  7.     term.clear()
  8.     term.setCursorPos(1,1)
  9.     print("Skriv passord: ")
  10.     local input = read("*")
  11.  
  12.     if input == pw then
  13.         term.clear()
  14.         term.setCursorPos(1,1)
  15.         print("Passord korrekt!")
  16.         rednet.broadcast("VAULT_OPEN")
  17.         print("Dør åpen")
  18.         sleep(opentime)
  19.         rednet.broadcast("VAULT_CLOSED")
  20.         print("Dør lukket")
  21.         sleep(1)
  22.  
  23.     else
  24.         term.clear()
  25.         term.setCursorPos(1,1)
  26.         print("Feil passord!")
  27.         sleep(5)
  28.     end
  29. end
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement