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