Advertisement
EmeraldSlash

Password Generator [ROBLOX]

Nov 15th, 2015
2,373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. local passwordLength = 15
  2. local passwordStrength = 3 -- 1 = basic, numbers only, 2 = medium, letters and numbers, 3 = letters and numbers, random capitalisation
  3.  
  4. local text = ""
  5.  
  6. function chooseChar()
  7.     local a = {"a","b","c","d","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}
  8.     local n = {1,2,3,4,5,6,7,8,9,0}
  9.     if passwordStrength == 1 then
  10.         return n[math.random(1,#n)]
  11.     elseif passwordStrength == 2 then
  12.         local num = math.random(1,2)
  13.         if num == 1 then
  14.             return a[math.random(1,#a)]
  15.         elseif num == 2 then
  16.             return n[math.random(1,#n)]
  17.         end
  18.     elseif passwordStrength == 3 then
  19.         local num = math.random(1,2)
  20.         if num == 1 then
  21.             local l =  a[math.random(1,#a)]
  22.             local num1 = math.random(1,2)
  23.             if num1 == 1 then
  24.                 l = l:lower()
  25.             elseif num1 == 2 then
  26.                 l = l:upper()
  27.             end
  28.             return l
  29.         elseif num == 2 then
  30.             return n[math.random(1,#n)]
  31.         end
  32.     end
  33. end
  34.  
  35. for i = 1,passwordLength do
  36.     text = text.. "" ..chooseChar()
  37. end
  38. wait()
  39. print("'" ..text.. "' is your new password!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement