Advertisement
SwiftWolfNetwork

razerblade14-login

Dec 26th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. -- Login System
  2. -- Written by razerblade14
  3.  
  4. term.clear() -- Clears the screen
  5. term.setCursorPos(1, 1) -- This places the print position to the top of screen
  6.  
  7. username = {"Connor", "Kyle", "guest"}  -- Here you need to define all usernames available
  8. password = {"Jade3ruby", "LOL", "guest01"}  -- Here you define what password each user has, remember to put user1's password in the first row and so on.
  9.  
  10. write("Username: ")
  11. user = read()
  12.  
  13. write("Password: ")
  14. pass = read('*') -- This prevents people from reading the password as you put it in
  15.  
  16. for i=1, #username do -- Starts a loop
  17.  if user == username[i] and pass == password[i] then
  18.    access = true
  19.  end
  20. end
  21.  
  22. if access == true then
  23. print("Logging in...")
  24. sleep(1)
  25. print("Welcome "..user)
  26. rs.setOutput("back", true)
  27. sleep(5)
  28. os.reboot()
  29. else
  30. print("Incorrect username and password combination")
  31. sleep(2)
  32. os.reboot()
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement