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)
local pagesObject = AvatarEditorService:GetInventory(assetTypes)
local currentPage = pagesObject:GetCurrentPage()
for i = 1, #currentPage do
local item = currentPage[i]
print(item)
end
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