Clothes not showing on the Rig (R6)

I’m working on a Roblox project where I generate NPCs with clothing, but I’m having issues with the clothes not appearing on the rig. Here are the details:

  1. Clothing Templates:
  • I’m using instances of Shirt and Pants and setting their templates like this:

shirtInstance.ShirtTemplate = top.ShirtTemplate
pantsInstance.PantsTemplate = bottom.PantsTemplate

  • The clothing items are stored in ReplicatedStorage under NpcFiles/NpcCharacteristics/Clothes.
  1. Accessing Template IDs:
    *I tried using both formats:
    rbxasset:// and
    http://www.roblox.com/asset/?id=
  2. Hierarchy:
    The clothing items are organized in pairs (e.g., MalePair, FemalePair), and I ensure that the Top and Bottom items exist in the selected clothing folder.
  3. Debugging Steps:
    Checked that the template IDs are correct and accessible.
    Checked that the clothing items are set to the correct Instance type (ShirtandPants`).
    Ensured that the NPC model is properly parented to the workspace after the clothing is applied.

Issue : Despite these steps, the clothing is not visible on the NPC model. Any advice on what might be causing this or how to debug further would be greatly appreciated!

The Clothes Template Ids are added from a script , The dummy on the Right is added manually but the one on the left is from the script