Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw -- Prevents CTRL+T shortcut
- term.clear() -- Clears the screen
- term.setCursorPos(1, 1) -- The places the print position to the top of screen
- username = {"Sam"} -- Here you need to define all usernames
- password = {"5151"} -- 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)
- sleep(2)
- shell.run("clear")
- print("Sam OS-0.1")
- else
- print("Incorrect username or password")
- sleep(2)
- os.reboot()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement