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
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 @Maximum_ADHD 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.
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.
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.
Hi, I love this Bundle giver as it’s easy to implement in game and is rock solid. However the bundles that have a generic face (ie. Telemon Chicken - 210 and Gingerbread - 286, overwrite the existing players head so look a little lame in game.
Is it possible to leave the head out of player transformation if the bundle doesn’t have a custom head or hat?