You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I’m trying to create a GUI button that when pressed it will send a specific message to discord via webhook. -
What is the issue? Include screenshots / videos if possible!
As of right now I have a script in workspace where if you join the game, a message will be sent to discord. But I can’t figure out how a message can be sent using a TextButton -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried finding solutions on both YouTube and DevFourm, I attempted any that seemed reliable to me but none worked. Besides that I tried to solve the issue myself by trying to put the script in the button and rewriting some of the script but still didn’t work.
Here is my current script located in workspace where if a player join a message will be sent
local url = "https://discord.com/api/webhooks/832756049986584607/MIFihgs5Rs-uyIbnH8Lv3eRH8U1nU60Jppyq3nNBoGfTByUEVOd00q0t6vqDgLFWI8sN"
local http = game:GetService("HttpService")
game.Players.PlayerAdded:Connect(function()
local data = {
['embeds'] = {{
['title'] = "**Assistance required**",
['description'] = "A player has requested assistance, please join the game."
}}
}
local finaldata = http:JSONEncode(data)
http:PostAsync(url, finaldata)
end)
Any help would be appreciated.