if clothes == "pants" then
player.Character:FindFirstChildOfClass("Pants").PantsTemplate = "rbxassetid://"..tonumber(clothesid)
end
error attempt to concatenate a nil value
i think its because it dont want the numbers outside the speechmarks but idk how to fix it

6 comments
What is your clothesid?
No I do not think you can change the ID of your clothing items through a script or in anyway. Is this the answer you are looking for? Please explain your problem briefly.
cloth id doesnt matter, its all the same for every clothing
It does if you're not using the template image
How do you define "clothesid"? Are there any letters in "clothesid"? If it's empty or there is any letters, tonumber() will return nil.
clothesid are always the letters of the clothing item