Shirt and pants not loading in

I am making a way for teams to have their own uniform and hats but right now it is currently semi working as it loads in the accessorys but not the shirts and pants thus making them naked.

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if player.Team == game.Teams.SRBR then
			wait(1)
			player.Character.Humanoid:RemoveAccessories()
			wait(1.5)
			local HatCloned = EBRTHELMET:Clone()
			HatCloned.Parent = character
			character:WaitForChild("Shirt").ShirtTemplate = "rbxassetid://5881185588"
			character:WaitForChild("Pants").PantsTemplate = "rbxassetid://5881193066"
			player.Character.Humanoid:AddAccessory(EBRTVEST)
			
		end
	end)	
end)

Any solutions?

Use InsertService to load the Pants and the Shirt

local InsertService = game:GetService("InsertService")

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if player.Team == game.Teams.SRBR then
		wait()
		local Hum = character:WaitForChild("Humanoid")
		Hum:RemoveAccessories()
		
		local HatCloned = EBRTHELMET:Clone()
		HatCloned.Parent = character
		
		local oldShirt = character:WaitForChild("Shirt")
		local oldPants = character:WaitForChild("Pants")
		oldPants:Destroy()
		oldShirt:Destroy()
		
		pcall(function()
			local modelShirt = InsertService:LoadAsset(5881185588)
			local modelPants = InsertService:LoadAsset(5881193066)

			local Shirt = modelShirt:WaitForChild("Shirt")
			local Pants = modelPants:WaitForChild("Pants")
			Shirt:Clone().Parent = character
			Pants:Clone().Parent = character

			modelPants:Destroy()
			modelShirt:Destroy()
		end)
		
		Hum:AddAccessory(EBRTVEST)
        end
	end)	
end)
1 Like

these shirts and pants might be deleted try putting a new one

It works but the accessories are still on the player.

You need to use the clothing templates themselves.

5881185399
5881193020

I’ve used this solution before and It didn’t work.

I’m referring to the character’s clothing, if you want to remove their accessories use the Humanoid:RemoveAccessories method.

https://developer.roblox.com/en-us/api-reference/function/Humanoid/RemoveAccessories

1 Like