#Why does roblox treat bundle models this way?😨😨😨😈🙈

1 messages · Page 1 of 1 (latest)

inland saffron
#

I am trying to create bundle model where you input bundle ID and it will import the bundle into an model that people in game can try and buy, however there is 1 problem the head doesnt get imported, besides that every other body part works fine, and maybe face too but i didnt try that one.

#

here is the handler, i will show send it in 2 messages since discord doesnt allow long messages

#

`task.wait(1)

local AES = game:GetService("AvatarEditorService")

local bundle = game:GetService("AssetService"):GetBundleDetailsAsync(script.Parent.BundleID.Value)
local toGet = {}

for _, data in pairs(bundle.Items) do
if not(data.Type == "UserOutfit") then
task.spawn(function()
table.insert(toGet, data.Id)
end)
end
end

local result = AES:GetBatchItemDetails(toGet, Enum.AvatarItemType.Asset)

local hum = script.Parent.HumanoidDescription

if script.Parent.BundleID.Value ~= 0 then
for _, data in pairs(result) do
if data.AssetType == "Face" then
hum.Face = data.Id
elseif data.AssetType == "Head" then
hum.Head = data.Id
elseif data.AssetType == "LeftArm" then
hum.LeftArm = data.Id
elseif data.AssetType == "LeftLeg" then
hum.LeftLeg = data.Id
elseif data.AssetType == "RightArm" then
hum.RightArm = data.Id
elseif data.AssetType == "RightLeg" then
hum.RightLeg = data.Id
elseif data.AssetType == "Torso" then
hum.Torso = data.Id
end
end

script.Parent:WaitForChild("Rig"):WaitForChild("Humanoid"):ApplyDescription(hum)

script.Parent.Rig.Name = bundle.Name
script.Parent.Name = bundle.Name

end`

#

`script.Parent.TRY.ProximityPrompt.Triggered:Connect(function(plr)
if plr.Character then
local char = plr.Character.Humanoid.HumanoidDescription:Clone()
char.Parent = script

    for _, data in pairs(result) do
        if data.AssetType == "Face" then
            char.Face = data.Id
        elseif data.AssetType == "Head" then
            char.Head = data.Id
        elseif data.AssetType == "LeftArm" then
            char.LeftArm = data.Id
        elseif data.AssetType == "LeftLeg" then
            char.LeftLeg = data.Id
        elseif data.AssetType == "RightArm" then
            char.RightArm = data.Id
        elseif data.AssetType == "RightLeg" then
            char.RightLeg = data.Id
        elseif data.AssetType == "Torso" then
            char.Torso = data.Id
        end
    end

    plr.Character.Humanoid:ApplyDescription(char)
    char:Destroy()
end

end)

script.Parent.BUY.ProximityPrompt.Triggered:Connect(function(plr)
game:GetService("MarketplaceService"):PromptBundlePurchase(plr, script.Parent.BundleID.Value)
end)`

inland saffron
#

@late summit do you know why?

late summit
inland saffron
#

so help me now please its small task

late summit
#

i havent used bundles before

#

so idk

inland saffron
#

yeah but maybe something is wrong with my code

#

like its simple code but i cannot figure it out

#

i really need someone who knows how to script unlike me to fix this xD

exotic otter
#

the head doesn’t load because it’s usually a separate asset or a dynamic head — you’ll need to fetch and add it manually.

inland saffron
#

oh but if i add it manually it wont affect buying, right?

exotic otter
#

yeah, it won’t affect buying — adding the head manually is just for looks in-game. when the player actually buys the bundle, roblox gives them the full thing automatically, including the head.

inland saffron
#

oh okay but i thought if it didnt add head the whole bundle would fail

#

do you have any code in mind that would add it manually?

exotic otter
#

the bundle won’t fail if the head’s missing — it’s just for looks. you can manually add the head using InsertService with the head asset ID.

#

but

#

i do have a code

#

that might work

exotic otter
#

the preview is just visual. the actual bundle purchase gives everything that's part of the bundle, no matter what you manually show.

inland saffron
exotic otter
#

char.Head = data.Id works only for classic heads — dynamic heads won’t show and must be loaded manually with InsertService. the purchase will still give the full bundle regardless.

exotic otter
#

np

sterile glenBOT
#

studio** You are now Level 5! **studio

exotic otter
#

yay

inland saffron
exotic otter
#

it might not work

#

but okay

#

``local InsertService = game:GetService("InsertService")

-- replace with the actual head asset ID
local headAssetId = 12345678

-- parent this to wherever you're previewing the bundle (like a model or character)
InsertService:LoadAsset(headAssetId):GetChildren()[1].Parent = yourModel.Head``

#

this is a quick way to manually add the head using InsertService but it probably wont work

inland saffron
#

i have plugin that crates models and adds bundles to them without the buy, so i might get the head from that, but should i add it at the bottom or where exactly

exotic otter
#

yes, add the head after ApplyDescription runs — that’s the safest spot to manually insert the head without it getting removed.

inland saffron
#

before here right?

exotic otter
#

yup, im pretty sure

inland saffron
sterile glenBOT
#

studio** You are now Level 4! **studio

exotic otter
#

you don’t need to add the face manually — as long as it’s a classic 2D face

inland saffron
#

so what is everything i need to add manually

#

i am noob in this lol

exotic otter
# inland saffron well if its 3d face?

3D faces (dynamic heads) need to be added manually using InsertService, just like dynamic heads — HumanoidDescription.Face won’t apply them.

exotic otter
inland saffron
#

oh okay thanks bro

exotic otter
#

np

inland saffron
#

here i made an new bundle code that works fine, i am just afraid if users will be able to buy the bundle, also i am sending it with file because roblox doesnt allow me to send the code for some reason

#

if you curious how did i fix it you can check it