Roblox Accessory Removal

I want to remove the hats of my character when the character accessories have fully loaded in, i was it to remove them when the character is added to the workspace.

i want it to keep the hairs, nothing else.

5 Likes

In roblox the different character accessories have different attachment names in the handles, so with this information we can figure out what accessories on the character are hairs and which ones are not

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		repeat task.wait() until player.Character
		for i,v in ipairs(character:GetChildren()) do
			if v:IsA("Accessory") and not v.Handle:FindFirstChild("HairAttachment") then
				v:Destroy()
			end
		end
	end)
end)
4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.