Advertisement
Guest User

ComputerCraft Username and Password System

a guest
May 13th, 2017
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. local valid
  2. local accounts = {
  3. ["username"] = "password",
  4. ["foo"] = "bar",
  5. ["xolbor"] = "roblox",
  6. ["anavrin"] = "nirvana"
  7. }
  8. //////By LeowFlow//////////
  9. ///////// V1.0////////////
  10. term.clear()
  11. term.setCursorPos(1, 1)
  12.  
  13. print("Enter username")
  14. write("> ")
  15. local input_user = read()
  16.  
  17. print("Enter password")
  18. write("> ")
  19. local input_pass = read("*")
  20.  
  21. for valid_user, valid_pass in pairs(accounts) do
  22. if (input_user == valid_user and input_pass == valid_pass) then valid = true end
  23. end
  24.  
  25. if valid then print("Access Granted") else print("Access Denied") end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement