Advertisement
NightWolf4Ever

password

Feb 18th, 2019
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. local side = "left"
  2. local password = "keter"
  3. local opentime = 5
  4. while true do
  5. term.clear() -- Clears the screen
  6. term.setCursorPos(1,1)
  7. write("Enter Password: ")
  8. local input = read("*")
  9. if input == password then -- Checks if the user inputted the correct password
  10. term.clear() -- Already explained up top
  11. term.setCursorPos(1,1)
  12. print("Password correct!")
  13. rs.setOutput(side,true)
  14. sleep(opentime)
  15. rs.setOutput(side,false) -- Stop outputting a redstone current
  16. else -- Checks if the user didn't input the correct password
  17. print("Password incorrect!") -- Prints 'Password incorrect!' to the screen
  18. sleep(2) -- Waits 2 seconds
  19. end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement