Changing shirt/pants template isnt working

Hello!

I am trying to change a model’s pants and shirt but it just isnt working properly. I am not getting any errors and it seems like it works when I look at the asset id, but it does not display…

Here is my code to change the Template:

charDummy.shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..tostring(shirt)
charDummy.pants.PantsTemplate = "http://www.roblox.com/asset/?id="..tostring(pants)

The string and pants variables are being pulled from a module in the server containing int values. They are then getting converted to strings and being attached to the asset id link to complete the template.

Please help me know what is wrong here

Hmm, can you confirm that your int values are valid?

1 Like

Yeah my int values are for sure valid, I tested it by manually entering it into the property box while a live session was running and it worked. For some reason the code is not working to change it.

Yeah, I think we need more information. If you don’t mind can you provide your module code so we can better help?

Well this is rather silly, my conversion was in a comment…
Thanks for the help!

I had the same issue and what I did to resolve it was to insert the shirt through InsertService and replace the player’s ShirtTemplate with the ShirtTemplate from the inserted shirt. Keep in mind that when you insert an asset through InsertService, it will be inserted as a model.

1 Like

I was actually getting the ID via a web api instead of making a model, I had a line that got the id from the data pulled but had it in a comment because of something else I was testing. Thanks plenty for the help though!

1 Like