Can't set Shirt/PantsTemplate on HumanoidDescription

I’ve been trying to create a character creation system for a game, and I’ve been using a “mannequin” to display how the player’s character will look like once he finishes that scene.

However, recently, I’ve noticed that I would need to assign each property to the Dummy’s HumanoidDescription in order to pass all of the mannequin’s properties to the character.

When I came across the clothing part, I figured it would be as simple as setting the HumanoidDescription’s Shirt/PantsTemplate to the one I have in my table. Yet, it doesn’t seem to work, and instead sends the error "value of type string cannot be converted to a number"

How could I fix this? Here is an excerpt of the code:

	["ClothingOptions"] = function()
		ShowcaseDummy.Shirt.ShirtTemplate = Clothes[CharacterProperties.ClothingOptions.Shirt].ShirtTemplate
		ShowcaseDummy.Pants.PantsTemplate = Clothes[CharacterProperties.ClothingOptions.Pants].PantsTemplate
		
		HumanoidDescription.Shirt = Clothes[CharacterProperties.ClothingOptions.Shirt].ShirtTemplate
		HumanoidDescription.Pants = Clothes[CharacterProperties.ClothingOptions.Pants].PantsTemplate
	end,

Not knowing what is in your table makes it difficult to say but remember that shirts and pants have Content ID’s that differ from the website catalog url of the shirts and pants. Make sure your table is just pointing to the numerical AssetId of the shirt/pants. If you use the catalog url, you can use tonumber to get the AssetId (numerical) value out.

local ShirtURL = "https://www.roblox.com/catalog/1234567/White-Shirt"
local assetId = tonumber(string.match(ShirtURL, "%d+") or 0) 
1 Like

Thank you, that was exactly it!

1 Like

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