"HttpService is not allowed to access ROBLOX resources"

I’m trying to make a script that, when the player joins, loads their saved avatars (so Characters->Creations in the Avatar menu). The problem is that when I run the script, I get the error: “HttpService is not allowed to access ROBLOX resources”.

Is there anything I can do about this?
Admittedly, the code I’m using is from another thread (with some small changes):

local http = game:GetService("HttpService")

local usrid=0
game.Players.PlayerAdded:Connect(function(plr)
	usrid = plr.UserId
end)
local url = "https://roblox.com/v1/users/"..usrid.."/outfits"
local request = http:GetAsync(url)
local decoded = http:JSONDecode(request)

if not decoded.data then
	return warn('Unable to get outfits')
end
if decoded.data then
	print(decoded.data)
end

You cannot send direct requests to roblox.com via HttpService. You need to use a proxy (roproxy is the most popular one)

local url = "https://avatar.roproxy.com/v1/users/"..usrid.."/outfits"

When making a request to roproxy, just change roblox to roproxy

3 Likes

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