Hello everyone!
Recently I started making a system similar to a locker for changing clothes (approximately like Catalog Avatar Creator) and ran into a problem. When using roproxy, the system gives me only one list where the items will be in disarray.
But I want to separate the inventory into sections by type: Hat, hair, face, etc.
But when I specify the desired type in the category in the proxy, it still gives me the same list. How else can I get a specific category of items using roproxy?
I used such a proxy, but the problem is that not all categories will have equal amounts of items. I want to insert exactly 30-40 items for each category, but given that the proxy has all, this won’t work.
I’m not familiar with the web API for the Roblox catalog, but I wondered if you tried using AvatarEditorService’s SearchCatalog function? It would eliminate the need for a proxy.
Here’s an example:
local aes = game:GetService("AvatarEditorService")
local params = CatalogSearchParams.new()
params.AssetTypes = {Enum.AssetType.Hat}
params.CreatorType = Enum.CreatorType.User
params.CreatorId = 1
local pages = aes:SearchCatalog(params)
--now just iterate over it how you would with any other Pages object
--since there's a whole lot of enums for accessories, here's a function to get them
local function getAccessories(): {Enum.AssetType}
local accessories = {} --this will hold the accessory enums we want
for _, enum in next, Enum.AssetType:GetEnumItems(), nil do
if (string.find(enum.Name, "Accessory")) then
table.insert(accessories, enum) --add it to the table if it's an accessory enum
end
end
return accessories --return the table of enums
end
local params = CatalogSearchParams.new()
params.AssetTypes = getAccessories()
params.Limit = 30 --it will always default to 30 when not specified