Script only working in Studio

Hello, I am a fairly new scripter here on the platform. I am making a script where when a division HR or main group HR joins the game it sends an alert on discord. My problem is the script only works in the studio play feature. And ideas why it might not be working? The script is below.

local url = "***This is where my webhook goes, removed for obvious reasons.***"
local http = game:GetService("HttpService")

game.Players.PlayerAdded:Connect(function(player)
	if player:GetRankInGroup(6032406) >= 64 then
	
	local data = {
		['embeds'] = {{
		['title'] = "GATR VIP Join",
		['description'] = player.Name .. " has joined the game, go protect them!"
		}}
	}
	
	local finaldata = http:JSONEncode(data)
		http:PostAsync(url, finaldata)
	elseif player:GetRankInGroup(6170760) >= 50 then
		local data = {
			['embeds'] = {{
				['title'] = "RG VIP Join",
				['description'] = player.Name .. " has joined the game, go protect them!"
			}}
		}

		local finaldata = http:JSONEncode(data)
		http:PostAsync(url, finaldata)
		end
end)

Discord webhooks have been blocked by Discord since about October 1st. Considering they’ve been blocked for this long, I wouldn’t be surprised if they won’t ever reinstate them.

You’ll have to use a proxy, such as this one:

If this is so than why does it still work in studio?

Http requests in studio are made by you, not the Roblox server(That’s why you should be careful when giving plugins access to http or insert random stuff into your game).