Advertisement
Guest User

Untitled

a guest
Aug 10th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. -- Login System
  2. -- Written by crump2
  3.  
  4. os.pullEvent = os.pullEventRaw -- Prevents CTRL+T shortcut
  5.  
  6. term.clear() -- Clears the screen
  7. term.setCursorPos(1, 1) -- This places the print position to the top of screen
  8.  
  9. username = {"user1", "user2", "user3"} -- Here you need to define all usernames available
  10. password = {"pass1", "pass2", "pass3"} -- Here you define what password each user has, remember to put user1's password in the first row and so on.
  11.  
  12. write("Bentuzername: ")
  13. user = read()
  14.  
  15. write("Passwort: ")
  16. pass = read('*') -- This prevents people from reading the password as you put it in
  17.  
  18. for i=1, #username do -- Starts a loop
  19. if user == username[i] and pass == password[i] then
  20. access = true
  21. end
  22. end
  23.  
  24. if access == true then
  25. sleep(1)
  26. print("Willkommen "..user)
  27. else
  28. print("Falsches Passwort oder Bentzername!")
  29. sleep(2)
  30. os.reboot()
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement