HumanoidDescription from outfit ID is faulty?

local Players = game:GetService("Players")

Players.CharacterAutoLoads = false

local function onPlayerAdded(player)
	local humanoidDescription = Instance.new("HumanoidDescription")
	humanoidDescription = Players:GetHumanoidDescriptionFromOutfitId(126)
	
	player:LoadCharacterWithHumanoidDescription(humanoidDescription)
end

Players.PlayerAdded:Connect(onPlayerAdded)

This is a very simple script that applies a HumanoidDescription instance to a player’s character model when they join the game. The error line is the function Players:GetHumanoidDescriptionFromOutfitId(). When I run the code, the output gives me a HTTP 400 BAD REQUEST error. The ID 126 is from this Roblox bundle from the Avatar Shop. Did I use the function correctly? How do I get the ID of an outfit to use this function?

The bundle itself is not an outfit, however it contains one:

local AssetService = game:GetService("AssetService")
local outfitID: number = 0
local bundleDetails = AssetService:GetBundleDetailsAsync(126)

for _,item in bundleDetails.Items do
	if item.Type == "UserOutfit"  then
		outfitId = item.Id
		break
	end
end

print(`The outfitId is {outfitId}`)
2 Likes

Thanks, but is there any other way I can get the outfit ID instead of using a script?

How many different bundles are you needing to load? If it’s just a small number, you could fetch them in advance and store those numbers instead?

bundle 126 is outfit 131830047

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.