Issue while reading player inventory

Hello,
Im triying to make a avatar editor and for that I intend to use the AvatarEditorService:GetInventory() but I have not been able because it returns me a table (and I don’t know how to use the table)
image

I tried looking the roblox web page about the AvatarEditorService and I found this code (the one that prints the table)

local pagesObject = AvatarEditorService:GetInventory(assetTypes)
local currentPage = pagesObject:GetCurrentPage()
for i = 1, #currentPage do
   local item = currentPage[i]
   print(item)
end

Can someone help me please?

1 Like

Is too sad me to answer myself, no?
Anyways, Here I found a code that works

local assetTypes = {
				Enum.AvatarAssetType.EmoteAnimation,
				Enum.AvatarAssetType.Face,
				Enum.AvatarAssetType.Gear,
				Enum.AvatarAssetType.HairAccessory,
				Enum.AvatarAssetType.Hat,
				Enum.AvatarAssetType.Head,
				Enum.AvatarAssetType.Pants,
				Enum.AvatarAssetType.Shirt,
				Enum.AvatarAssetType.TShirt,
				Enum.AvatarAssetType.WaistAccessory,
			}
			
			AvatarEditorS:PromptAllowInventoryReadAccess()
			AvatarEditorS.PromptAllowInventoryReadAccessCompleted:Wait()
			local Inventory = AvatarEditorS:GetInventory(assetTypes)
			while true do
				for i, Item in ipairs(Inventory:GetCurrentPage()) do
					print(Item.AssetId)
				end
				Inventory:AdvanceToNextPageAsync()
				if Inventory.IsFinished then
					break
				end
			end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.