This script is made to override the character and delete the player's accessories. Here's my code:
local player = game.Players:GetPlayerFromCharacter(script.Parent)
local character = player.Character
local character_children = character:GetChildren()
--:ClearCharacterAppearance()
character:WaitForChild("ForceField")
character.ForceField:Destroy()
local hats = character:FindFirstChildWhichIsA("Accessory")
hats:Destroy() --This is where I want to remove the hats, which it doesn't
character.Head.Transparency = 1
character.Torso.Transparency = 1
character["Left Arm"].Transparency = 1
character["Right Arm"].Transparency = 1
character["Left Leg"].Transparency = 1
character["Right Leg"].Transparency = 1
character.Sound:Destroy()
character.Head.face:Destroy()
character.Humanoid.JumpPower = 0
character.Humanoid.CameraOffset = Vector3.new(0, 10, 0)
I tried this: game.Players.LocalPlayer:ClearCharacterAppearance() and it doesn't get rid of the accessories.
What do I do!?

2 comments
why u gave me a min??? i just gave u a exaple how to find them
Learn how to use loops, it'll definitely optimise your scripts and help you in the long run.