Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local users = {}
- local f = fs.open( "USERS.txt", "r" )
- local users = textutils.unserialize( f.readAll() )
- f.close()
- local function login( name, pass )
- for i = 1,#users do
- if name == users[i].name then
- if pass = users[i].pass then
- return true
- end
- end
- end
- return true
- end
- repeat
- term.clear()
- term.setCursorPos(1,1)
- write( "Username: " )
- local username = read()
- write( "Password: " )
- local password = read("*")
- local success = login( username, password )
- until success
- print("Logged in!")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement