Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local HttpService = game:GetService("HttpService")
- local webhookUrl = "https://discord.com/api/webhooks/YOUR_WEBHOOK_URL_HERE" -- replace with your Discord webhook URL
- -- create a function to send a message to the Discord webhook
- local function sendMessageToDiscord(message)
- local data = {
- ["content"] = message
- }
- local encodedData = HttpService:JSONEncode(data)
- local headers = {
- ["Content-Type"] = "application/json"
- }
- local requestInfo = {
- ["Url"] = webhookUrl,
- ["Method"] = "POST",
- ["Headers"] = headers,
- ["Body"] = encodedData
- }
- HttpService:RequestAsync(requestInfo)
- end
- -- create a function to generate a strong password when the generate button is clicked
- local function onGenerateButtonClicked()
- local password = ""
- local length = 12 -- you can adjust the length of the generated password
- local chars = {"abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "0123456789", "!@#$%^&*()-_+="}
- -- the above table contains four different character sets: lowercase letters, uppercase letters, numbers, and special characters
- for i = 1, length do
- local charSet = chars[math.random(1, 4)] -- randomly select a character set
- local char = string.char(charSet:byte(math.random(1, #charSet))) -- randomly select a character from the selected set
- password = password .. char -- append the character to the password
- end
- sendMessageToDiscord("A new password has been generated: " .. password) -- send a message to the Discord webhook with the generated password
- end
- -- connect the function to the generate button's MouseButton1Click event
- generateButton.MouseButton1Click:Connect(onGenerateButtonClicked)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement