Player Created Gamepasses

I won’t give you all my scripts, but this script on the server-side should get you very far.

local http = game:GetService("HttpService")

local function getGamepasses(plr, user, gamepasses, pageNumber, lastLength)
	gamepasses = gamepasses or {}
	pageNumber = pageNumber or 1
	lastLength = lastLength or math.huge

	local requestUrl = "https://games.RoProxy.com/v2/users/"..user.."/games?accessFilter=Public&sortOrder=Asc&limit=50"
	local success, result = pcall(function()
		return http:GetAsync(requestUrl)
	end)
	if success then
		pcall(function()
			local alldata = http:JSONDecode(result)
			for _,GameInfo in pairs(alldata["data"]) do
				local gameId = GameInfo.id
				local url = "https://games.RoProxy.com/v1/games/"..gameId.."/game-passes?limit=100&sortOrder=Asc"

				local success2,result2 = pcall(function()
					return http:GetAsync(url)
				end)

				if success2 then
					result2 = http:JSONDecode(result2)
					for _,GamepassDetail in pairs(result2["data"]) do
						local gamepassId = GamepassDetail.id
						table.insert(gamepasses,gamepassId)
					end
				end
			end
		end)

	else
		warn(result)
		getGamepasses(plr, user, gamepasses, pageNumber, lastLength)
	end
	return gamepasses
end

game.ReplicatedStorage.GetGamepasses.OnServerInvoke = getGamepasses
1 Like

I use this, and when I am printing the gamepasses they have, it prints all of them 3 times.

it keeps saying http 404 not found

There has been a large effort to refactor Roblox’s public API, which has now been dubbed “Open Cloud”. You can learn all about it on the Open Cloud documentation page. The inventory API got a large overhaul, which leads me to believe the legacy API was sunsetted or damaged in this process. The new inventory API still enables you to read a player’s game-passes using the following endpoint:

https://apis.roblox.com/cloud/v2/users/{user_id}/inventory-items?maxPageSize=100&filter=gamePasses=true

You can learn more about the new API here (landing) and here (API reference). You’re required to create an API key for all Open Cloud interactions; you can learn how to do that here. This will require you to add an x-api-key header to all of your GET requests, so study how either HttpService:GetAsync or HttpService:RequestAsync enables you to do that.

At the time of this reply, “apis.roproxy.com” is a valid domestic bypass URL

1 Like

Thx for the response

Kkkkkkkkkkkk

char limit that y I spammed

So basically I gotta learn http service respectively?

If you are not already comfortable with it, yes. That is how you make HTTP request within a Roblox game. However, if you’re making an external application, you’ll need to research which HTTP library is best suited for your needs. Most modern languages come with some sort of native HTTP library. Open Cloud is ultimately designed for external use

1 Like

So for a game to show a players game pass I need to use http service, thanks for the response! Appreciate it!

Game-passes that they own. This is largely populated by other games’ game-passes. If you intended to display a player’s public assets for sale, say, for a Donate Me game, you’ll have to filter for game-passes created by that player, especially ones for sale. There is ultimately more you can find about a player’s marketable assets, which increases donation opportunities. You can investigate this proof-of-concept GitHub repository I developed for doing just that. It was designed for external use, however, so it may be difficult to dissect

1 Like

Okay, thanks will read about it