Maybe it errors when there is no second page available>?
No, the repeat would then end if there was no new available cursor. I believe it has something to do with the proxy I’m using, as it is provided a different cursor than Roblox’s API is returning, but even then, the Roblox side still sometimes errors. Ok, I had a few less items on the roblox API side, so i believe the problem could be some of the items in the list.
Alright, I changed to the item list I was using on the roblox side and it works better and doesn’t error:
local HTTP = game:GetService("HttpService")
local assetlist = "Pants,Shirt,Hat,Face,Gear,Audio,Face,Package,Animation,Torso,RightArm,LeftArm,LeftLeg,RightLeg,HairAccessory,FaceAccessory,NeckAccessory,ShoulderAccessory,FrontAccessory,BackAccessory,WaistAccessory,EmoteAnimation,Video,JacketAccessory,RightShoeAccessory,DressSkirtAccessory"
game.Players.PlayerAdded:Connect(function(plr)
local inventory = {}
local cursor = nil
repeat
local url = "https://inventory.roproxy.com/v2/users/"..plr.UserId.."/inventory?assetTypes="..assetlist.."&itemsPerPage=10&sortOrder=Asc"
if cursor then
url ..= "&cursor="..cursor
end
local data = HTTP:GetAsync(url ,true)
data = HTTP:JSONDecode(data)
if #data.data > 0 then
for i,v in pairs(data.data) do
table.insert(inventory, v)
end
end
if data.nextPageCursor then
cursor = data.nextPageCursor
end
until not data.nextPageCursor
print(inventory)
end)
1 Like
Roblox is picky about which items u can run but all the ones i included should be good