How to get all players shirts, pants and t-shirts of player

A new game called PLS DONATE has been introduced in Roblox, this is the most requested tutorial of everyone since no one knew how to get all players shirts and pants correctly

:warning: You need to know basic scripting and a bit of https service before reading the tutorial

This is an easy tutorial so read carefully

Step 1 Enable https requests

Enable https requests in your game

To do that, go to your game settings and do as given in the image below:

Step 2 Understanding asset id

This is highly important for this tutorial

Each asset in Roblox have a different asset id


If I say asset id 11 are cool, it means Shirts are cool
So, basically asset id is a id given for each asset type

Step 3 Understanding the proxy server link

This is the link: https://robloxdevforumproxy.glitch.me/users/inventory/list-json?assetTypeId=11&cursor=&itemsPerPage=100&pageNumber=%x&sortOrder=Desc&userId=1606095040

It will get all the shirts of my friend, because the userid in the link is my friend’s profile

You can see the last digits of the link is the userid, you can keep it with your id to get your shirts and pants

:warning: Note that if your inventory is private then it cannot get your shirts and pants

If you notice the link carefully, it has a assetTypeId=11, it means it will get all the asset of that type from the userid mentioned

Step 4 Making the script

Don’t copy paste scripts, this is not a copy paste session
Its easy, so try it yourself, it would be nice

Now as you know to get the player shirts, you need to keep the userid in the link
Do it like this:

local httpsservice = game:GetService("HttpService")
local url = "https://robloxdevforumproxy.glitch.me/users/inventory/list-json?assetTypeId=11&cursor=&itemsPerPage=100&pageNumber=%25x&sortOrder=Desc&userId=" -- the url I kept in tutorial
-- also make sure you remove the userid which is in the link if any
local assetid = {2,11,12} -- t shirt assets,shirts and pants

game.Players.PlayerAdded:Connect(function(plr)
    local linkforplayer = url..plr.UserId -- we add the userid to the link
    local datafromlink = httpsservice:GetAsync(linkforplayer,true) -- second argument is cache, I kept it true because its needed for this system
    -- the data we get from the link is in JSON format so we have to decode it to lua
    local readabledata = httpsservice:JSONDecode(datafromlink)
    print(readabledata)
end)

Read the script carefully

Try to run it

You will notice it prints the player shirts data
image

This is the shirt data, i will tell later in this tutorial on how to get shirt names and all other things of it

Step 5 Getting shirts and pants and t shirts, not just shirts

As I told earlier, the script gets info from the link, it means all the data in the link are shirts owned by player

How to get pants and t-shirts too?
If you remember I’ve told you the assetid in the link, if the asset id in the link is shirts id then it will get shirts, if its pants id it will get pants, same with t-shirts

Now, to get the t-shirts and pants, we have to replace the asset id in the link with 2,11,12 or t shirt id, shirt id, and pants id

Then it will get all player shirts and pants

This is how you do it:

local assetid = {2,11,12} -- t shirt assets,shirts and pants

game.Players.PlayerAdded:Connect(function(plr)
    for i = 1,3 do -- this a number, we use this number to get the id from the asset id table
        local linkforplayer = "https://robloxdevforumproxy.glitch.me/users/inventory/list-json?assetTypeId="..assetid[i].."&cursor=&itemsPerPage=100&pageNumber=%25x&sortOrder=Desc&userId="..plr.UserId
        local datafromlink = httpsservice:GetAsync(linkforplayer,true) -- second argument is cache, I kept it true because its needed for this system
        -- the data we get from the link is in JSON format so we have to decode it to lua
        local readabledata = httpsservice:JSONDecode(datafromlink)
        print(readabledata)
    end
end)

Try to run the script after done

You will see 3 tables:

  • Shirts table
  • Pants table
  • T-shirts table

image

Now, you got all the data of the player’s assets
The tutorial is done

You can read further to check how to read shirts data from the table

Step 6 (Optional) Reading the data from the tables

You can actually see, each table have these:
image

All the items which you mostly need are in the Items table

You can actually see each item in the item table have alot of stuff too
image

To get all shirts, you can do

for i,v in pairs(table["Data"]["Items"]) do
   print[v["Creator"])
end

It prints the creator table in all the items

And to get player made shirts
You can do something like

for i,v in pairs(table["Data"]["Items"]) do
   if v["Creator"]["CreatorTargetId"] == plr.UserId then
      print(v["Item"]["AssetId"].." is owned by the player")
   end
end

However I am not showing how to make an entire game like that, because its not good and you should take permission from the owner of that game before making a copy of it

So this is how you get the player’s assets and check if the player owns them
If you know basic scripting, you can easily make something like that game from referring to this basic tutorial

Additional Info

All asset Id





The API documentation link is here

How to get player owned shirts without public inventory

Here is a topic by Forummer which might get the player inventory even if its private
Player Created Gamepasses - #3 by Forummer

16 Likes

wow this is actually really usefull but one thing is that instead of using robloxdevforumproxy which kinda feels fishy you can use roproxy but still this is useful!
P.S instead of using httpservice there is a function in game.players which kinda can get the player model and then u can extract the things e.t.c

5 Likes

you can but you have to loop all catalog items to know which are owned

3 Likes

How would i go about getting the gamepasses?
I’ve been trying and all i can get so far is

local Gamepasses = "https://search.roproxy.com/catalog/json?CatalogContext=2&Category=34&CreatorID=%s&CurrencyType=0"

Tbh, i don’t even know if this is correct either.

3 Likes

Yes you can do that, but just like @hakobmher told you have to loop through all the catalog items

To get the catalog items, you need to use https request to a proxy server

Roblox have a limit of 500 requests per min per server, there are over a million shirts and pants in the catalog, if you do this it takes 30 mins to get all the items of a player, and if you have many players in the server each player has to wait 30 mins, it takes 8 hours for a player to get a stand

No one waits soo long, so this is a bad idea to use PlayerOwnsAsset

Gamepasses are not part of the catalog they are part of the game, you cannot get it from ro proxy and ro proxy is no longer available

Same with your suggestion to, ro proxy is no longer available sadly, and you need to use robloxdevforumproxy

1 Like

I have no idea why this works, but i just entered 34 (asset id of gamepasses) into the assset table, and it litteraly works lol. Kinda suprised me, as i didn’t expect it to work.

Yes it can work because the its the api link your getting the info from, if the api is based on players games than catalog it works fine

I’m using this

"https://robloxdevforumproxy.glitch.me/users/inventory/list-json?assetTypeId="..v.."&cursor=&itemsPerPage=100&pageNumber=%25x&sortOrder=Desc&userId="..userid

image
You cannot do that, I tried to do it, but gamepass is not an asset its a gamepass uh so it don’t exist for that api

But it litteraly works lol, idk what to say i didn’t expect it.

Could you send me a image of your script and the output?

local MS = game:GetService("MarketplaceService")
local http = game:GetService("HttpService")
local assetid = {
	["TShirt"] = 2,
	["Shirt"] = 11,
	["Pant"] = 12,
	["GamePass"] = 34
}
local function GetContent(username,userid, tshirts, cursor)
	local Contents = {}
	for iid,v in pairs(assetid) do
		local linkforplayer = "https://robloxdevforumproxy.glitch.me/users/inventory/list-json?assetTypeId="..v.."&cursor=&itemsPerPage=100&pageNumber=%25x&sortOrder=Desc&userId="..userid
		local datafromlink = http:GetAsync(linkforplayer,true)
		local readabledata = http:JSONDecode(datafromlink)
		local suc, er = pcall(function()
			for i,v in pairs(readabledata["Data"]["Items"]) do
				if v["Creator"]["Id"] == userid then
					print(v)
					Contents[iid] = v["Item"]["AssetId"]
				end
			end
		end)
		if not suc then
			warn(er)
		end
	end
	return Contents
end

This works, adds it to a table and i can check the website manually with the gamepass id and it’s correct.

1 Like

wait wha- how it works?

Anyway thx for info, I will add it in tutorial

If your only checking for shirts and pants if the player is ingame, you can simply loop through the character and check if it’s a shirt or pants or a decal(cuz tshirts) and return them

1 Like

Edit: I misunderstood, this example will only get the items the player is currently wearing. The original poster is setting out to get all the clothes in a player’s inventory.

You can avoid using a proxy which is icky, with GetCharacterAppearanceInfoAsync or going through the player’s character and checking if the child IsA(“Pants”) or IsA(“Shirt”)

here’s an example getting the player’s shirt using GetCharacterAppearanceInfoAsync

--!strict
local players: Players = game:GetService("Players")
local function get_player_shirt_id(userid: number): number?
	local success, info = pcall(players.GetCharacterAppearanceInfoAsync, players, userid)
	if success then		
		for i, asset in ipairs(info.assets) do
			if asset.assetType.name == "Shirt" then
				return asset.id
			end
		end
	end
	return nil
end

This gets only the shirt and pants the player currently wear isnt it?

Edit : The meaning of this proxy is that it gets all the shirts / pants and other types Player Owns not only the shirt and pant the player has on

You can get any accessory or clothing the player has on. You would simply change the asset.assetType.name == "Shirt" to “Pants” or “T-Shirt” or “Neck Accessory”, you could edit it to get all of them at the same time, it’s only an example for the shirt

[quote=“JaTYUH, post:13, topic:1675658”]

local MS = game:GetService("MarketplaceService")
local http = game:GetService("HttpService")
local assetid = {
	["TShirt"] = 2,
	["Shirt"] = 11,
	["Pant"] = 12,
	["GamePass"] = 34
}
local function GetContent(username,userid, tshirts, cursor)
	local Contents = {}
	for iid,v in pairs(assetid) do
		local linkforplayer = "https://robloxdevforumproxy.glitch.me/users/inventory/list-json?assetTypeId="..v.."&cursor=&itemsPerPage=100&pageNumber=%25x&sortOrder=Desc&userId="..userid
		local datafromlink = http:GetAsync(linkforplayer,true)
		local readabledata = http:JSONDecode(datafromlink)
		local suc, er = pcall(function()
			for i,v in pairs(readabledata["Data"]["Items"]) do
				if v["Creator"]["Id"] == userid then
					print(v)
					Contents[iid] = v["Item"]["AssetId"]
				end
			end
		end)
		if not suc then
			warn(er)
		end
	end
	return Contents
end

I started to use this but how would I display it on signs?

2 Likes

Thats not what this proxy is for Its for getting All the shirts and Pants Player has in his inventory!!

1 Like

This has been extremely helpful, thanks!!

1 Like