I have made an HTTP script that sends a message to Discord. It is for a commission system. The player does get kicked after they click send, but the message doesn't send. I was wondering where I went wrong with this. I tried making it send just a small message, and it worked, but when I send this message, it doesn't. There are no output errors.
Server Script:
local webhook = "censored" local remote = game.ReplicatedStorage.Send local HTTP = game:GetService("HttpService") function Fire(player, msg) local payload = HTTP:JSONEncode({ content = msg, username = player.Name.." - (#"..player.UserId..")" }) HTTP:PostAsync(webhook, payload) end remote.OnServerEvent:Connect(Fire)
Local Script (in the button):
local remote = game.ReplicatedStorage.Send local plr = game.Players.LocalPlayer local need = script.Parent.Parent.QAA local contact = script.Parent.Parent.QBA local money = script.Parent.Parent.QCA local skills = script.Parent.Parent.QDA function Send() local msg = "I need: "..need.Text..". You can contact me by: "..contact.Text..". I am willing to pay you: "..money.Text..". I want the skill level of my developer(s) to be: "..skills.Text.."." remote:FireServer(msg) plr:Kick("We will get back to you as soon as we can! Thank you for requesting!") end script.Parent.Activated:Connect(Send)
I'm guessing that this is for a Discord webhook.
Discord has blocked requests from Roblox so if your webhook was:
http://discordapp.com/api/1234
you would have to change it to:
http://discord.osyr.is/api/1234