Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Login System
- -- Written by razerblade14
- term.clear() -- Clears the screen
- term.setCursorPos(1, 1) -- This places the print position to the top of screen
- username = {"Connor", "Kyle", "guest"} -- Here you need to define all usernames available
- 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.
- write("Username: ")
- user = read()
- write("Password: ")
- pass = read('*') -- This prevents people from reading the password as you put it in
- for i=1, #username do -- Starts a loop
- if user == username[i] and pass == password[i] then
- access = true
- end
- end
- if access == true then
- print("Logging in...")
- sleep(1)
- print("Welcome "..user)
- rs.setOutput("back", true)
- sleep(5)
- os.reboot()
- else
- print("Incorrect username and password combination")
- sleep(2)
- os.reboot()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement