Advertisement
Guest User

Untitled

a guest
Mar 15th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw -- Prevents CTRL+T shortcut
  2.  
  3. term.clear() -- Clears the screen
  4. term.setCursorPos(1, 1) -- This places the print position to the top of screen
  5.  
  6. username = {"Jayden"}
  7. password = {"password"}
  8. write("Username: ")
  9. user = read()
  10.  
  11. write("Password: ")
  12. pass = read('*') -- This prevents people from reading the password as you put it in
  13.  
  14. for i=1, #username do -- Starts a loop
  15.  if user == username[i] and pass == password[i] then
  16.    access = true
  17.  end
  18. end
  19.  
  20. if access == true then
  21. print("Logging in...")
  22. sleep(1)
  23. print("Welcome "..user)
  24. else
  25. print("Incorrect username and password combination")
  26. sleep(2)
  27. os.reboot()
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement