So what this script is when player joins game and checks its team it should give him shirt and pants of the team's color but it does not and if he changes teams it should give clothes on the teams color..
game.Players.PlayerAdded:connect(function(Plr) Plr.CharacterAdded:connect(function(Char) for i,v in pairs(Char:GetChildren()) do if v.ClassName == "Shirt" or v.ClassName == "Pants" then v:Destroy() end end if Plr.TeamColor == BrickColor.new("Brick yellow") then x = Instance.new("Shirt",Char) x.ShirtTemplate = "132601095" else x = Instance.new("Shirt",Char) x.ShirtTemplate = "132601106" end end) end)
whats the prob ?
The issue is that you are trying to set ShirtTemplate
to the ID of the clothing. You need to set it to the address of the content:
game.Players.PlayerAdded:connect(function(Plr) Plr.CharacterAdded:connect(function(Char) for i,v in pairs(Char:GetChildren()) do if v:IsA("Clothing") then -- Here, rather than checking if it's a Shirt or Pants, I check if it inherits from Clothing. v:Destroy() end end if Plr.TeamColor == BrickColor.new("Brick yellow") then local x = Instance.new("Shirt",Char) x.ShirtTemplate = "http://www.roblox.com/asset/?id=132601094" else local x = Instance.new("Shirt",Char) x.ShirtTemplate = "http://www.roblox.com/asset/?id=132601105" end end) end)
I also noticed you used the ID of the shirt item, rather than the shirt image. I corrected that for you in the script above. Additionally, I indented the code, which is good practice.