How to load Pants/Shirts using scripts

Hi!
I have been trying to make a gui with viewport frames that have “Dummys” inside which displays the shirt the dummys are wearing, just like a character customization gui. But my problem is, the shirts doesnt load in:

I have tried this methods:
Shirt.ShirtTemplate = “rbxassetid//:”…id
Shirt.ShirtTemplate = “http://www.roblox.com/asset/?id=”…id

None of these works
Am i doing it wrong, or is there another way to display them. Please tell me of there is thanks

1 Like

Are you sure you’re using the right ID because you have to use the texture ID of those shirts and pants, instead of the ID of the buy able version on catalog.

I am using this Id:

Yeah, you can’t use that ID for shirts. You need to use their texture IDs. Which for that shirt, it’s 3407942426.

Sorry for asking but how do i obtain the texture id instead?

You can find the normal ID like so, as mentioned here:

function idFromAsset(assetId)
    return tonumber(game:GetObjects("http://www.roblox.com/asset/?id="..assetId)[1].Texture:match("%d+"))
end
print(idFromAsset(AssetId) --returns Texture Id

It’s worth noting that this can only be used through the command bar or plugins, and not through scripts, for security reasons.

3 Likes

unfortunately it gives this error
image

As I said, this can only be done through the command bar or plugins unfortunately. It would be nice if roblox would shift to solely using AssetIds, as it would make life much easier.

Yep that will be a great feature

Do you wanna insert it to the game? if so you can use combination of ContentProvider and InsertService. Although i never really use these @Android62903

i am trying to load the shirts to the game, i will have a try of that ContentProvider

1 Like