local function RetrieveIdsFromHumanoidDescription(HumanoidDescription)
local Items = {}
local Accessories = HumanoidDescription:GetAccessories(true)
for i, v in ipairs(Accessories) do
print(i,v)
end
for _, AccessoryInfo in pairs(Accessories) do
table.insert(Items, AccessoryInfo.AssetId)
end
for _, BodyPartName in pairs(BodyParts) do
local BodyPartId = HumanoidDescription[BodyPartName]
if BodyPartId ~= 0 then
table.insert(Items, BodyPartId)
end
end
if HumanoidDescription.Shirt ~= 0 then
table.insert(Items, HumanoidDescription.Shirt)
end
if HumanoidDescription.GraphicTShirt ~= 0 then
table.insert(Items, HumanoidDescription.GraphicTShirt)
end
if HumanoidDescription.Pants ~= 0 then
table.insert(Items, HumanoidDescription.Pants)
end
if HumanoidDescription.Face ~= 0 then
table.insert(Items, HumanoidDescription.Face)
end
return Items
end
:GetAccessories() returns an empty table sometime, especially in-game. I tried testing within Studio the problem does not seem to arise that much as it is in-game. Any approach would really help !