Accessories Remove

Hello guys, I’m creating an accessories giver system but I don’t know how to make that when I click on Hair for example, the game removes the actual hair inside the player, but only the Hair and not other items. Here the code:

	for i,v in ipairs(x.Character:GetDescendants()) do
			if v:isA("Accessory") and v.AccessoryType.Hair then
				v:Destroy()
			end
		end
1 Like
if v.AccessoryType == Enum.AccessoryType.Hair

A list of Enums are available here.

https://developer.roblox.com/en-us/api-reference/enum/AccessoryType

2 Likes