HTTP 403 (Forbidden) - Webhook works fine in studio, but not in game?

So I have a discord webhook to log everything, and it’s been working perfectly fine. I’ve been working on a new update, but haven’t published it yet, so there’s no reason why it wouldn’t work in game, but it works in studio. I looked at other topics, but they didn’t seem to apply.
Here’s my script:

local HS = game:GetService("HttpService")
local Link = "I'm not letting you have this, smh."

game.Players.PlayerAdded:Connect(function(plr)
	wait(1)
	local Leaderstats = plr:WaitForChild("leaderstats")
	local Data = {
		["content"] = plr.Name .. " has joined. " .. "Rank = " .. Leaderstats:FindFirstChild("AF Rank").Value .. ". Phase: " ..  Leaderstats:FindFirstChild("Phase").Value .. ". Private ServerId" .. game.PrivateServerId
	}
	Data = HS:JSONEncode(Data)
	
	HS:PostAsync(Link, Data) --Error on this line.
	
	plr.Chatted:Connect(function(msg)
		local split = string.split(msg, " ")
		for i,v in pairs(split) do
			if v == "@everyone" then
				split[i] = "-everyone"
			elseif v == "@here" then
				split[i]  = "-here"			
			end
		end
		local censoredMessage = ""
		
		for i,v in pairs(split) do
			censoredMessage = censoredMessage .. " " .. v
		end
		local CoolMsg = {
			["content"] = plr.Name .. ": " .. censoredMessage
		}
		CoolMsg = HS:JSONEncode(CoolMsg)
		
		HS:PostAsync(Link, CoolMsg)
	end)
end)

Important Info: Works in studio, not in game. Didn’t publish a single update yet, so no reason why it shouldn’t be working.

Error in game (Not in studio)

Any thoughts?

2 Likes

Please search first before posting.

1 Like

Recently, discord decides to block Roblox servers using webhooks and API.

1 Like