How to import head bundle without replacing whole body?

Hello. I made a system where the player can insert the ID of a bundle from the marketplace into a text box in order to import it into the game and apply to their own character. The system works for heads as well, however, it removes any bundle / package from the character (reverting it to 1.0) before changing the head mesh.

How could I allow it to swap the head mesh without replacing the entire body, should the bundle only contain a head? Thanks in advance

I imagine that I would have to detect if the bundle contains only a head or a full body, and if it only contains a head, it should replace only the head mesh. But I don’t know how to do that.

Assuming you’re talking about Dynamic Head bundles, here is what I did for one of my things!!

local bundleItems -- Assuming you got the items from the bundle
local humanoid -- pathway
local humDesc = humanoid:FindFirstChildOfClass("HumanoidDescription")

for _, item in bundleItems do
	if not item.Name:find("Dynamic Head") then continue end
	humDesc["Head"] = item.Id
	humanoid:ApplyDescriptionReset(humDesc)
	break
end
1 Like

Hello. Sorry for my late response.
How does that code work and how could I implement it into mine? I’m trying to get a better understanding of it.
I wanted to detect if the bundle contains only a head, and if so, import only the head without changing other meshes. I can see that your code detects if the bundle has a dynamic head, but I have a bad feeling it would interfere with the loading of full bundles.

1 Like

All bundles from their bundle info have a thing called UserOutfit, which acts like an outfit.
That might explain the reverting to 1.0

Also, all bundles have extra info and will not be only a head.
An example can be shown from this dynamic head bundle and its info:

[1] =  â–Ľ  {
	["Id"] = 71993263971199,
	["Name"] = "Silly Smile - Dynamic Head",
	["Type"] = "Asset"
},
[2] =  â–Ľ  {
	["Id"] = 14618207727,
	["Name"] = "Default Mood",
	["Type"] = "Asset"
},
[3] =  â–Ľ  {
	["Id"] = 4313357581472228,
	["Name"] = "Silly Smile Head",
	["Type"] = "UserOutfit"
}

We only want the Dynamic Head and its Id as the UserOutfit will give us a funky outfit that will override a player’s outfit. Hence the if not item.Name:find("Dynamic Head") then continue end

Now, what about full/character bundles?
They spew out similar info above, but also showing its body parts and their info.
Even having the same - Dynamic Head section.
So, you want to grab that instead!
(Classic bundles will give a face/decal)


humDesc["Head"] = item.Id Uses the grabbed Dynamic Head Id and then sets the HumanoidDescription’s head Id to the Dynamic Head’s Id instead.
Since changing any of the Ids of a HumanoidDescription will NOT change the mesh/appearance of the player!

That’s why there is the humanoid:ApplyDescriptionReset(humDesc)!
Which will reset the humanoid’s appearance to match the altered description.
And since we only changed the head Id, it won’t mess with anything else!


Hopefully, you get what I mean but if ya need more help, let me know!
For implementation, I don’t really know cause I made the code for a plugin of mine, not a game and I don’t know what you coded up over there!!

I understand your code works for specifically changing only the head, but I’m still trying to understand how I could detect whether the bundle is a head or a full body package so I could have it working under the same UI. Is there simply no way to do that? Because I can’t find any way of doing it. Unless if you did say how it’s done and it went over my head, in which case, I would apologize.

I did find out about a “BundleType” enum but I have no idea of how it’s used and how it works.

Oh, alrighty, so when you get the bundle info they have a thing called BundleType a string
So you would want “DynamicHead” for head bundles only or “BodyParts” for character bundles