So basicaly I made an accessory remover that removes your accessories once your character has been added to the game so it removes even after respawn. It should remove only if you are NOT on one specific team but it doesn't work and I don't know why.
game:GetService("Players").PlayerAdded:Connect(function(plr) plr.CharacterAdded:connect(function(char) if plr.TeamColor ~= BrickColor.new("White") then for i,v in pairs(char:GetChildren()) do if v:IsA("Accessory") then v:Destroy() end end end end) end)
It is possible that when the character is added, not all the accessories have been loaded. You can fix that by simply doing:
game:GetService("Players").PlayerAdded:Connect(function(plr) plr.CharacterAppearanceLoaded:Connect(function(char) if plr.TeamColor ~= BrickColor.new("White") then for i,v in pairs(char:GetChildren()) do if v:IsA("Accessory") then v:Destroy() end end end end) end)
Also, there is a method in a Humanoid that already does this function: Humanoid:RemoveAccessories()