Help with a mod report system not sending the webhook

Hi,

I’ve put the ServerScriptService script code in, “ReportServer” or something like that, and say, "I’m having issues with the script webhook working in-game, even though it works perfectly fine on Roblox studio. I keep getting these error messages debugging. Error sending webhook: HttpError: NetFailed and Error Object: HttpError: NetFailed. I don’t think it would have anything to do with the client because this is all on the server side and it worked on Roblox Studio.

If anyone could help me figure out how to resolve this, I would be grateful.

I’ll attach a copy of the script

local WebhookPrefix = “https://hooks.hyra.io/
local WebhookPath = “” – Replace with your actual Discord webhook path

– Combine the prefix and path to construct the full webhook URL
local Webhook = WebhookPrefix … WebhookPath

local RS = game:GetService(“ReplicatedStorage”)
local Event = RS:WaitForChild(“SubmitEvent”)
local https = game:GetService(“HttpService”)

– Retry settings
local MAX_RETRIES = 3
local RETRY_DELAY = 5 – in seconds

Event.OnServerEvent:Connect(function(plr, Player, Reason, Desc, Proof)
print(“OnServerEvent triggered!”)

local data = {
    ['embeds'] = {{
        ['title'] = "Reported Player",
        ['description'] = "A player has submitted an in-game report!",
        ['thumbnail'] = {
            ['url'] = 'https://media.discordapp.net/attachments/1038554017736953977/1042150401564225536/stufflogo2.jpg?width=676&height=676',
        },
        ["fields"] = {
            {
                ["name"] = "Submitted by",
                ["value"] = plr.Name,
                ["inline"] = true
            },
            {
                ["name"] = "Player Reported",
                ["value"] = Player,
                ["inline"] = false
            },
            {
                ["name"] = "Reason for Report",
                ["value"] = Reason,
                ["inline"] = false
            },
            {
                ["name"] = "Description",
                ["value"] = Desc,
                ["inline"] = false
            },
            {
                ["name"] = "Evidence",
                ["value"] = Proof,
                ["inline"] = false
            },
        }
    }}
}

print("Data:")
for key, value in pairs(data) do
    print(key, value)
end

local finaldata = https:JSONEncode(data)

print("Before HTTP request")

local success, response = pcall(function()
    return https:PostAsync(Webhook, finaldata, Enum.HttpContentType.ApplicationJson)
end)

print("After HTTP request")

if success and response == "OK" then
    print("Webhook request successful!")
else
    warn("Error sending webhook:", response)

    -- Print the full error object
    if not success then
        warn("Error object:", response)
    end
end

end)

If I’m not mistaken Discord has banned all requests made to it by Roblox servers, due to frequent abuse of rate limits. If you want to communicate with Discord from a Roblox server you need to proxy the request.

In studio the server is your own PC, so when you make a request to any website there, it’s your PC making the request, not a Roblox server, that’s why the error only appears in live servers.

1 Like

https://hooks.hyra.io/ has shutdown (if you go to their site you can see that the site cant be reached), i suggest using a different proxy like https://webhook.lewisakura.moe/

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.