Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is wrong with this HTTP script? Why won't it send a message?

Asked by 5 years ago

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)
0
HTTPs service uses iFrame which is a HTML value that only sends a message to other servers related to the origin to the server, not 3rd party sites. I think the only thing you could do outside of roblox links is .org links as they are global, don't say I don't know too. I am a web developer. ClockWallie 28 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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

Ad

Answer this question