Hello, I was working on a project that includes a script where I remove ALL accessories EXCLUDING HairAttachments but I wanted to add Face and Hat attachments as well and leave out the rest to be destroyed. Here is the script for anyone who is willing to help!
local Players = game:GetService("Players")
function PlayerAdded(Player)
Player.CharacterAppearanceLoaded:Connect(function(Character)
local parts = Character:GetChildren()
for i = 1, #parts do
local instanceA = parts[i]
if (instanceA.ClassName == "Accessory") then
if not instanceA.Handle:FindFirstChild("HairAttachment") then
parts[i]:Destroy()
end
end
end
end)
end
Players.PlayerAdded:Connect(PlayerAdded)

3 comments
replace face? bla with FaceAttachment or whatever the attachment is called, i myself don't have face accessories to test (=
Or you can just iterate Character:GetDescendants() and check if its name is "HairAttachment", etc.
It is shorter than that B)