Advertisement
AkoaHAAAA

adads

Mar 30th, 2023
700
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.74 KB | None | 0 0
  1. local HttpService = game:GetService("HttpService")
  2. local webhookUrl = "https://discord.com/api/webhooks/YOUR_WEBHOOK_URL_HERE" -- replace with your Discord webhook URL
  3.  
  4. -- create a function to send a message to the Discord webhook
  5. local function sendMessageToDiscord(message)
  6.     local data = {
  7.         ["content"] = message
  8.     }
  9.     local encodedData = HttpService:JSONEncode(data)
  10.     local headers = {
  11.         ["Content-Type"] = "application/json"
  12.     }
  13.     local requestInfo = {
  14.         ["Url"] = webhookUrl,
  15.         ["Method"] = "POST",
  16.         ["Headers"] = headers,
  17.         ["Body"] = encodedData
  18.     }
  19.     HttpService:RequestAsync(requestInfo)
  20. end
  21.  
  22. -- create a function to generate a strong password when the generate button is clicked
  23. local function onGenerateButtonClicked()
  24.     local password = ""
  25.     local length = 12 -- you can adjust the length of the generated password
  26.     local chars = {"abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "0123456789", "!@#$%^&*()-_+="}
  27.     -- the above table contains four different character sets: lowercase letters, uppercase letters, numbers, and special characters
  28.  
  29.     for i = 1, length do
  30.         local charSet = chars[math.random(1, 4)] -- randomly select a character set
  31.         local char = string.char(charSet:byte(math.random(1, #charSet))) -- randomly select a character from the selected set
  32.         password = password .. char -- append the character to the password
  33.     end
  34.  
  35.     sendMessageToDiscord("A new password has been generated: " .. password) -- send a message to the Discord webhook with the generated password
  36. end
  37.  
  38. -- connect the function to the generate button's MouseButton1Click event
  39. generateButton.MouseButton1Click:Connect(onGenerateButtonClicked)
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement