For more understanding with the title, I mean that the script doesn’t delete the clothes for a specific team what the script does is to check if you have clothes on and if so it deletes it. But it does equips the clothes but It doesn’t delete the Player’s original clothes. So, basically sometimes the clothes will be layered.
function addClothing(player: Player, character, hum: Humanoid)
repeat task.wait() until player.Character
repeat task.wait() until player:HasAppearanceLoaded()
if player.Team == nil then return end
if rs:FindFirstChild("Teams"):FindFirstChild(player.Team.Name) then
for i, clothing in pairs(rs:FindFirstChild("Teams"):FindFirstChild(player.Team.Name):GetChildren()) do
if clothing:IsA("Shirt") or clothing:IsA("Pants") then
if character:FindFirstChild(clothing.Name) then
character:FindFirstChild(clothing.Name):Destroy()
print("Deleted clothes")
end
clothing:Clone().Parent = character
print("Inserted clothes")
end
end
end
end
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
addClothing(Player, Character)
Player:GetPropertyChangedSignal("Team"):Connect(function())
addClothing(Player, Character, Humanoid)
end)
end)
end)