How to put a shirt id on a character using script?

No nothing there (character limit)

Gimme a sec to work this out :)

1 Like

I think I found a solution! Let me try it out :)

1 Like

Try this

Label = script.Parent
Next = Label.Next
Back = Label.Back
Count = 1
Character = workspace.CustomizableCharacter
ShirtIds = {"http://www.roblox.com/asset/?id=1821394","http://www.roblox.com/asset/?id=5929995954","http://www.roblox.com/asset/?id=5960301418","http://www.roblox.com/asset/?id=6664129832","http://www.roblox.com/asset/?id=6456895422"}
Shirt = Instance.new("Shirt",Character)

Back.MouseButton1Click:Connect(function()
	if Count > 1 then
		Count -= 1
		Label.Text = Label.Name..(" ")..Count
		Shirt.ShirtTemplate = ShirtIds[Count]
	end
end)

Next.MouseButton1Click:Connect(function()
	if Count < 5 then
		Count += 1
		Label.Text = Label.Name..(" ")..Count
		Shirt.ShirtTemplate = ShirtIds[Count]
	end
end)
1 Like

Sorry I responded late I was playing with my friends oof

It makes this error:

Are you sure you have the correct Asset ID’s?

(Post hidden by original poster)

Ill put “using script” in the title

You could use InsertService:LoadAsset() to gather appropriate ShirtTemplates - for your case:

local InsertService = game:GetService("InsertService")
local ShirtIds = {
    1821394, 5929995954, 5960301418, 6664129832, 6456895422
}
for index, shirtId in pairs(ShirtIds) do --for each shirtId in ShirtIds do
    ShirtIds[index] = InsertService:LoadAsset(shirtId):GetChildren()[1].ShirtTemplate
    --as :LoadAsset returns a Model - ShirtGraphic
end)
--table is now updated with appropriate values.

Then you’d use Shirt.ShirtTemplate, and change the value of it to an ID from ShirtIds.

Edit: forgot to add .ShirtTemplate when indexing.

3 Likes

Lemme test that out really quickly

It says I can only insert assets from the server but im using a local script so that people don’t see ur character

Oh, right. You’d need to create a temporary Shirt anywhere, like the workspace, and fill all the IDs in the .ShirtTemplate property - and replace the ID in the table with the new value.

Otherwise, you could create a modulescript that has the table updated by the server.

1 Like

Sorry could you dumb that down a bit? Im kinda new to scripting so I have no idea what u said oof

Create a shirt, copy and paste the shirt ID in the .ShirtTemplate property, and insert the result in the ShirtIds table. Repeat this process for every shirt that you have.

1 Like