JoeNoIce

startup login

Jun 3rd, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. username = {"okguess", "admin", "user", "guest"} --[[This is the usernames]]--
  2. password = {"password", "admin", "user", "guest"} --[[This is the passwords for the users]]--
  3.  
  4. os.pullEvent = os.pullEventRaw
  5.  
  6. write("Username: ")
  7. user = read()
  8.  
  9. for i=1, #username do
  10. if user == username[i] then
  11. print("User found")
  12. sleep(1.5)
  13. write("Password: ")
  14. pass = read()
  15. if pass == password[i] then
  16. access = true
  17. else print("Incorrect")
  18. sleep(1)
  19. os.reboot()
  20. end
  21. end
  22. end
  23.  
  24. if access == true then
  25. print("Logging in...")
  26. sleep(1)
  27. print("Welcome user")
  28. else
  29. print("Incorrect username and/or password")
  30. sleep(2)
  31. os.reboot()
  32. end
Advertisement
Add Comment
Please, Sign In to add comment