I have been trying to find a way to look at a users inventory, and for a script to figure out how many clothing is owned by a specific group (In this case, the group that I own). I came across a post which was written sometime last year in seemed to have the answer, but after trying to figure it out I couldn’t. Here was the original post.
I have tried to take the sample of code and modify it in my own way, but simply can’t figure out what it does. Here is the code that I have tried:
local HttpService = game:GetService("HttpService") local InventoryUrl = "https://robloxdevforumproxy.glitch.me/users/inventory/list-json?assetTypeId=11&cursor=&itemsPerPage=100&pageNumber=%x&sortOrder=Desc&userId=%i" -- used in a string.format thingy -- In an event game.Players.PlayerAdded:Connect(function(Player) local Inventory = HttpService:JSONDecode(HttpService:GetAsync(string.format(InventoryUrl, 1, Player.UserId))) -- function for _, item in next, Inventory do print(#item:GetChildren()) end end)
Most of the time the attemps that I have tried have done nothing, or just printed random numbers. Is there anyway around this or maybe a differens solution that would also work?