How to make a secure login

I am making an admin panel, but I don’t know how to make a secure login page with multiple user/pass
code I’ve got so far:

script.Parent.MouseButton1Click:Connect(function()
local usernames = {"V33S", "Admin", "zxzxz"}
 local passwords = {"password1", "password2", "password3",}
    	
   if script.Parent.Parent.pass.Text == table.find(usernames, game.Players.LocalPlayer.Name) and script.Parent.Parent.name.Text == table.find(passwords) then
    		print("correct")
else
            print("incorrect")
end
        end)

Obviously the user names and passwords will be changed and so will some of the code, it’s just I don’t know how to check multiple user names/pass words at once to see if they match with what was given in the username/password TextBox.

2 Likes

you didn’t gave it the password so it can’t find I think

and try to use for i v in pairs loop instead of table.find?

Try this:

if table.find(usernames, script.Parent.Parent.Username.Text) then
   if table.find(passwords, script.Parent.Parent.pass.Text) then
      print('logged in')
end
1 Like

Use a hashmap, this lets you find a password from a username

local logins = {
  ["metatablecatgirl"] = "NotMyRealPassword",
  ["admin"] = "Devforum123"
}

You can then just index the username, then check the password doing:

local getPwd = logins[username]
if getPwd and password == getPwd then
  print("lol logged in")
end

Replace username with your username input and password with your password input