local module = {}
local dss = game:GetService("DataStoreService")
local http = game:GetService("HttpService")
local mps = game:GetService("MarketplaceService")
local mainStore = dss:GetDataStore("MainDataStore")
module.assetTypeIds = {
["T-Shirt"]=2,
["Shirt"]=11,
["Pants"]=12,
["Pass"]=34,
}
module.getItems = function(assetId,plrId)
local allItems = {}
local success, errormsg = pcall(function()
local done = false
local nextPageCursor
while done == false do
local data
if nextPageCursor then
data = http:GetAsync("https://www.roproxy.com/users/inventory/list-json?assetTypeId="..tostring(assetId).."&cursor="..nextPageCursor.."&itemsPerPage=100&userId="..tostring(plrId))
else
data = http:GetAsync("https://www.roproxy.com/users/inventory/list-json?assetTypeId="..tostring(assetId).."&cursor=&itemsPerPage=100&userId="..tostring(plrId))
end
if data then
data = http:JSONDecode(data)
local items = data["Data"]["Items"]
for _, item in pairs(items) do
table.insert(allItems, item)
end
if data["Data"]["nextPageCursor"] then
nextPageCursor = data["Data"]["nextPageCursor"]
else
done = true
end
else
warn("No data.")
end
end
end)
if success then
print("Successfully retrieved data.")
else
warn(errormsg)
end
local createdByUser = {}
for i, item in pairs(allItems) do
pcall(function()
if (item["Creator"]["Id"] == plrId) and (item["Product"]["IsForSale"] == true) then
table.insert(createdByUser,item)
end
end)
end
return createdByUser
end
#Do you guys know how to get all gamepasses the players have been created
6 messages · Page 1 of 1 (latest)
** You are now Level 2! **