Hi! For the past 3-4 hours I have been working on this single webhook script trying to get it to work, but it just won’t! It gives out no errors and I have tried removing prints and such. Not a thing happens. I’ve also tried to remove the canary on the link. Any help is appreciated!
game.ReplicatedStorage.AppCenterPD.OnServerEvent:Connect(function(plr, q1q, q2q, q1a, q2a)
local HttpService = game:GetService("HttpService")
webhook = "https://canary.discordapp.com/api/webhooks/hidden/hidden" -- I tried this without the canary.
local data = {
["embeds"] = {{
["title"] = " ",
["description"] = "**Application Submitted** \n *Type:* PD \n *Q1:* "..q1q.."\n"..q1a.."\n *Q2:* "..q2q.."\n"..q2a
}}
}
HttpService:PostAsync(webhook, HttpService:JSONEncode(data))
end)
local PD = script.Parent.Parent
local questions = PD.questions
local submit = PD.submit
local q1 = questions.q1
local q2 = questions.q2
submit.MouseButton1Click:Connect(function()
local user = game.Players.LocalPlayer.Name
local q1q = q1.question.Text
local q2q = q2.question.Text
local q1a = q1.answer.Text
local q2a = q2.answer.Text
game.ReplicatedStorage.AppCenterPD:FireServer(q1q,q2q,q1a,q2a)
game.Players.LocalPlayer:Kick("Completed application!")
end)
Rather than using a RemoteEvent, use a RemoteFunction. This will allow yield the clients code until the web request has been processed. It’ll also allow you to return information, if there is an error, to the client so that you don’t kick them if it fails.