Unable to change classic clothing inside script

Having some issues changing the character’s shirts & pants, and am not really sure why it isn’t working. Looked through the documentation and am pretty sure this is how it’s supposed to be done??

Have tried listing the templates in most link formats, as well as using HumanoidDescription.

local character = player.Character
local shirt = character:FindFirstChild("Shirt")
local pants = character:FindFirstChild("Pants")
if not shirt then
	shirt = Instance.new("Shirt")
	shirt.Parent = character
	shirt.Name = "Shirt"
	shirt.ShirtTemplate = "rbxassetid://210082048"
else
	shirt.ShirtTemplate = "rbxassetid://210082048"
end
if not pants then
	pants = Instance.new("Pants")
	pants.Parent = character
	pants.Name = "Pants"
	pants.PantsTemplate = "rbxassetid://210083295"
else 
	pants.PantsTemplate = "rbxassetid://210083295"
end

Any help would be greatly appreciated, thank you!

what is this script parented to

okay im not exactly sure why, but i was messing around with it in studio and i found that subtracting 1 from the ID made the clothing show up. i recommend doing your own research onto this because i cant explain it

local character = player.Character
local shirt = character:FindFirstChild("Shirt")
local pants = character:FindFirstChild("Pants")
if not shirt then
	shirt = Instance.new("Shirt")
	shirt.Parent = character
	shirt.Name = "Shirt"
	shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=210082047"
else
	shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=210082047"
end
if not pants then
	pants = Instance.new("Pants")
	pants.Parent = character
	pants.Name = "Pants"
	pants.PantsTemplate = "http://www.roblox.com/asset/?id=210083294"
else 
	pants.PantsTemplate = "http://www.roblox.com/asset/?id=210083294"
end

To say I’m confused would be a tremendous understatement. I gave what you said a go and it WORKED. I was curious to give it a try with other shirts just to test out the theory and it didn’t replace those AT ALL, even with the correct ID.

Did some searching of the IDs 210082047 and 210083294 and I believe the final conclusion is that those IDs provide the image decal of the shirt template as an image itself. I’m not sure if it was just coincidence that the IDs below them are the image decals of the shirt template (might not be coincidences, I assume the shirts are old and maybe that’s how old roblox functioned).

Still don’t understand why it didn’t work for the other shirts I tested, but am very grateful for the help.

How did you think of subtracting 1 from the IDs?? Never something I would’ve thought of.

Nevertheless I appreciate the help a lot, don’t need the other shirts as these shirts/pants were all I needed to function. Thank you very much.

i noticed it because when i took the ids and put them into shirts in the explorer, they gave the ids i mentioned in the code

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