How do I use GetBundleDetailsAsync() to put a bundle on a character?

#1

Assume I want my rig to look like this:
https://www.roblox.com/bundles/374/The-Thrasher

How do I use GetBundleDetailsAsync() to get the package info I need and then dress my character up in that package? I’m not sure what to do with everything it returns and the dev hub is literally useless. Thanks :slight_smile:

1 Like

#2

Related Documentation Request: No information on GetBundleDetailsAsync


So, I went and wrote a fairly lengthy script to fetch what this API returns. I seem to have a general understanding of what it looks like, so however you use this information is up to you. I believe there are samples of this API’s usage around the DevForum, but that’s all I know.

-- Usage
local Details = game:GetService("AssetService"):GetBundleDetailsAsync(374)

Returns:
number Id
string Description
string Name
string BundleType
table Items

In the Items table are more tables representing the parts of the bundle. Each table is structured as follows:
number Id
string UserOutfit
string Name


On another note though, I did find some code related to the usage of GetBundleDetailsAsync by @CloneTrooper1019 on a Release Notes tab. This is for when Humanoid descriptions are live, so if you’re keen on waiting for that, there’s one way to help with this. Code here.

There’s also a plugin by @Stickmasterluke you can check the source code of to see how he uses GetBundleDetailsAsync to change bundles. That post is here.

5 Likes

No information on GetBundleDetailsAsync
#3

When I unpack this and attempt to print, I get an output of nil. Why would this be the case?

0 Likes

#4

It’s returning a nil value because the return of GetBundleDetailsAsync is a dictionary, not a standard table. If you try unpacking a dictionary/array, you’ll get a nil value. You can experiment using another dictionary as well.

local Table = {"Yes", "No", "Maybe"}
print(unpack(Table)) --> Yes No Maybe

local Dictionary = {["Yes"] = true, ["No"] = false, ["Maybe"] = 0}
print(unpack(Dictionary)) -->

Whereas you can use unpack on a table with only values and not keys, you will have to iterate through a dictionary or index its members directly.

3 Likes

#5

Thanks so much for taking the time to do that man. I’ll definitely check it out when I have a sec!

1 Like

#6

I reverse engineered what it returned by passing the response dictionary into HttpService:JSONDecode(), then I passed the JSON string into a JSON beautifier so I could see the structure of the dictionary.

My Bundle Giver handles all of the provided data manually, but I’ll probably update it to use some of the new HumanoidDescription APIs once they’re enabled.

5 Likes