Help with using proxies to get players created gamepasses and shirts

Hello, I am trying to get the gamepasses and shirts that players have created using proxies. I havent really used proxies that much before and am not sure how I could achieve this. I’ve watched a couple tutorials on youtube for people making pls donate booths (I’m making something different) but when I test these in studio none of them work apart from one which gives the shirts I’ve created but not the gamepasses. That script is below. Any help is very much apricated.

Script:

local AssetManager = {}

local HttpService = game:GetService("HttpService")
local UrlA = "https://catalog.roproxy.com/v1/search/items/details?Category=3&CreatorName="

local function getUserGeneratedTShirtsRecursive(username, SignPrices, tshirts, cursor)
	tshirts = tshirts or {}
	local requestUrl = UrlA
	local data = HttpService:JSONDecode(HttpService:GetAsync(UrlA .. username)).data
	if data then
		table.sort(data,
			function(a,b)
				return a.price < b.price
			end
		)
		for _, item in ipairs(data) do
			local e,s = pcall(function()
				table.insert(tshirts, item.id)
				local newBtn = script.Template:Clone()
				local price = item.price
				newBtn.PurchaseButton.Text = "$"..price
				newBtn.LayoutOrder = price
				newBtn.Name = price
				newBtn.ImportantValues.AssetId.Value = item.id
				newBtn.Parent = SignPrices

			end)
		end
	end
	return tshirts
end

local UrlB = "https://www.roproxy.com/users/inventory/list-json?assetTypeId=34&cursor=&itemsPerPage=100&pageNumber=%s&userId=%s"

local function getUserCreatedGamepassesRecursive(userId, SignPrices, gamepasses, pageNumber, lastLength)
	gamepasses = {}
	pageNumber = pageNumber or 1
	lastLength = lastLength or math.huge

	local requestUrl = UrlB:format(pageNumber, userId)
	local success, result = pcall(function()
		return HttpService:GetAsync(requestUrl)
	end)

	if success then
		print("gamepasses found")
		if result then
			local success2, result2 = pcall(function()
				print("Working...")
				return HttpService:JSONDecode(result)
			end)

			if success2 then
				if result2 then
					print("success 3")
					for _, gamepass in ipairs(result2.Data.Items) do
						print(result2.Data.Items)
						if gamepass.Creator.Id == userId and table.find(gamepasses, gamepass.Item.AssetId) == nil then
							table.insert(gamepasses, gamepass.Item.AssetId)
							print("Success 3.5")
							local e,s = pcall(function()

								local newBtn = script.Template:Clone()
								print("Success 4")
								local price = gamepass.Product.PriceInRobux
								newBtn.Name = price
								newBtn.PurchaseButton.Text = "$"..price
								newBtn.LayoutOrder = price
								newBtn.ImportantValues.AssetId.Value = gamepass.Item.AssetId
								newBtn.ImportantValues.AssetType.Value = "Gamepass"
								newBtn.Parent = SignPrices
							end)
						end
					end
				else
					warn(result)
					getUserCreatedGamepassesRecursive(userId, gamepasses, pageNumber, lastLength)
				end
			end
		else
			warn(result)
			getUserCreatedGamepassesRecursive(userId, gamepasses, pageNumber, lastLength)
		end
		return gamepasses
	end
end


function AssetManager:GetAssets(Player, BoothUI)
	getUserGeneratedTShirtsRecursive(Player.Name, BoothUI)
	getUserCreatedGamepassesRecursive(Player.UserId, BoothUI)
    
end

return AssetManager

What specifically doesn’t work for you? You will not be able to get gamepasses, only if the player has an inventory open (for everyone)

1 Like

Sorry for the late reply, thats probably the issue then lol but just wondering, I have my inventory private and pls donate is still able to get my created gamepasses

You need to get all the player’s places and all the game passes for those places.
Get places: https://games.roproxy.com/v2/users/{user_id}/games?accessFilter=Public&limit=50
Get passes: https://games.roproxy.com/v1/games/{place_id}/game-passes?sortOrder=Asc&limit=50
Places must be public

1 Like

Thank you ill give that a try.

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