Why do Pants/Shirt links not work?

If I try applying this ID of pants to a Humanoid,382537806 via code it does nothing, however if I manually put that into the PantsTemplate, it changes its number and then works? Why is this a thing? Since when was this a thing? How can I add pants to a character via code and not have to do it manually?

local NewPants = Instance.new('Pants')
NewPants.Name = 'Pant'
NewPants.PantsTemplate = 'rbxassetid://' .. PantsID
NewPants.Parent = Dummy

Does not work
Link to pants
https://www.roblox.com/catalog/382537806/Jean-Shorts

You’re using the asset id (the website id) not the image id (something else i guess, not 100% sure on the term).
You need to do the “change the number thing” in the shirttemplate and when it gives you the correct id you can use that.

This has always been a thing to my knowledge.

1 Like

So in other words I have to manually do it? I know of the whole ‘-1 away from the id’ to get the template, but that doesn’t always work and template can sometimes be hundreds of numbers away.

It hasn’t because I’ve used this exact same chunk of code in a previous game and had it work in that game 1-2 years ago

You can insert a ShirtTemplate anywhere in the explorer and insert the image id and it will return the correct one

If the above suggestions don’t work for you, here’s the correct id you should use: 382537805
(used a chrome extension to get it)

2 Likes
game:GetService("InsertService"):LoadAsset(pantsId)
-- returns a model with the proper pants instance inside
-- also works with shirts & t-shirts and pretty much any accessory
3 Likes

Problem with this is I’d have to load it in from the server (trying to do all this via client) and just too much work for just 1 line of code in the server to do 1 small thing

I was going to suggest HumanoidDescriptions, but it seems that like InsertService they only work through the server. Not sure there’s any simple method of doing so through the client alone.

Can’t use shirt and pants templates tho, cause when I apply those ID’s to the HumanoidDescription then they don’t work

Is there a reason that the client can’t request info from the server which the server returns back? Just because some things do not work on the client doesn’t mean the server can’t help.

1 Like

Aren’t you renaming NewPants to Pants at line 2? If I remember correctly, doesn’t that mean you’d have to change the names of the NewPants s below that? Try adding line 2 last, and see if that works.

Edit: I know this is an old thread, but I still want to help out if I can.