Printing the Assets of Shirts

I am extremely tired right now, and I am having a brain fart. I need help printing
the asset and the price of robux.

(I DID NOT CREATE THIS CODE, SIMPLY TESTING! AND EXPERIMENTING WITH
DIFFERENT API’S!)

local httpsservice = game:GetService("HttpService")
local MS = game:GetService("MarketplaceService")
local http = game:GetService("HttpService")
local assetid = {
	["Shirt"] = 11,
}
local function GetContent(username,userid)
	local Contents = {}
	local Count = 0
	local DidError = false
	local success, Error = pcall(function()
		for iid,v in pairs(assetid) do
			task.spawn(function()
				local linkforplayer = "https://www.roproxy.com/users/inventory/list-json?assetTypeId="..v.."&cursor=&itemsPerPage=50&pageNumber=%25x&sortOrder=Desc&userId="..userid
				local datafromlink = http:GetAsync(linkforplayer,false)
				local readabledata = http:JSONDecode(datafromlink)["Data"]["Items"]
				for i,v in pairs(readabledata) do
					if v["Creator"]["Id"] == userid then
							local Asset = MS:GetProductInfo(v["Item"]["AssetId"])["PriceInRobux"]
							if Asset ~= nil then
							Contents[iid.." "..i] = v["Item"]["AssetId"]
							print(Contents)
							end
						end
					end
				end)
				Count += 1
			end
	end)
	
	if not success then
		print(Error)
		Contents = {}
		return GetContent(username,userid)
	end
	repeat task.wait() until Count == 4 or not success

	if success then
		print(Contents)
		return Contents

	end
end

If you didn’t create the script then try asking its creator.

1 Like

I tried different timezones lol

This script is returning asset IDs, to get their prices you’d need to use the :GetProductInfo() instance method of the marketplace service.

https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/GetProductInfo

2 Likes

No, I already have, I need to print them, I dont know where to put the print…

oh hey, i made that.
that was for my pls donate type game i decided to make
what is there you want to know?
do you want to save each asset as a table, as in
Table[AssetID] = {Price,CreatorID}
or what is there you’re trying to achieve?

1 Like

Im trying to print the shirts and the price for the sign, could you help me?