Webhook only sends in Studio

Hello Roblox Community,
So I’ve made a script which sends a message with a Webhook ( DISCORD). Its works fine in Roblox Studio, but when I’m in my game in the normal Roblox, it doesnt send.
Here are my scripts:
This script is inside a button:

local ReportEvent = game.ReplicatedStorage.RemoteEvents.Feedback
local Debounce = false
local Players = game:GetService("Players")

script.Parent.MouseButton1Click:Connect(function()
	local rate = script.Parent.Parent.RateInt.Value
	local reason = script.Parent.Parent.Frame.TextBox.Text

	if rate ~= nil and reason ~= nil then

		if Debounce then return end
		Debounce = true
		
		script.Parent.Parent.LoadingCircle.Visible = true
		wait(2)
		script.Parent.Parent.done.Visible = true
		script.Parent.Parent.LoadingCircle.Visible = false
		wait(1)
		script.Parent.Parent.done.Visible = false
		script.Parent.Parent.Enabled = false
		
		ReportEvent:FireServer(rate, reason)

		wait(7)
		Debounce = false
	end

end)

And this is inside ServerScript Service:

local ReportEvent = game.ReplicatedStorage.RemoteEvents.Feedback
local HTTPService = game:GetService("HttpService")
local Webhook_URL = --I will not say the url xd


ReportEvent.OnServerEvent:Connect(function(plr, rate, reason)
	local Data = {
		["content"] = "",
		["embeds"] = {{
			["title"] = "**New Feedback from** ".. plr.Name .. " (" .. rate .. ")", -- title
			["description"] = "**Feedback : **          " .. reason,
			["type"] = "rich",
			["color"] = tonumber(0xff0065), --any hex colour code
			}
		}}
	local Data = HTTPService:JSONEncode(Data)
	HTTPService:PostAsync(Webhook_URL, Data)
end)

I hope someone can help me, bye!
~ Maini

Do you have HTTP enabled?
If HttpService is off , you need to enable it by going to Game Settings > Security > Allow HTTP Requests . Once you have enabled it, your script should work in normal Roblox.

If HttpService is on and your script still isn’t working in normal Roblox, there could be other issues causing the problem. You could try adding some print statements to your script to help debug the issue. For example, you could add a print statement after the line ReportEvent:FireServer(rate, reason) to see if the event is being fired correctly. You could also add a print statement after the line HTTPService:PostAsync(Webhook_URL, Data) to see if the webhook is being sent correctly.

Okay, so there comes this message:
grafik
In that line is this:

HTTPService:PostAsync(Webhook_URL, Data)

I fixed it myself! I changed the “discord.com” from the webhook to “hooks.hyra.io

2 Likes

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