I want to create a race system (similar to rogue lineage). The player will have some accessories removed, and others not. For example, only the player’s hair will stay. The issue is, the player will sometimes still have hats, even though I am removing them. I have tried different solutions, (for loops, humanoid descriptions) and none seem to fix the issue. I have not seen any posts similar to this.
This code is run in a module after the character is added.
function CharacterSetup:SetupApperance(Player,Race,Clothes,LastName)
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
Player.CharacterAppearanceLoaded:Wait()
repeat task.wait() until Character:FindFirstChild("Humanoid"):FindFirstChild("HumanoidDescription")
--Body Parts--
local humanoidDescription = Humanoid:GetAppliedDescription() -- remove package
humanoidDescription.Head = 0
humanoidDescription.Torso = 0
humanoidDescription.RightLeg = 0
humanoidDescription.LeftLeg = 0
humanoidDescription.RightArm = 0
humanoidDescription.LeftArm = 0
humanoidDescription.HatAccessory = ""
humanoidDescription.BackAccessory = ""
humanoidDescription.FrontAccessory = ""
humanoidDescription.NeckAccessory = ""
humanoidDescription.ShouldersAccessory = ""
humanoidDescription.WaistAccessory = ""
Humanoid:ApplyDescription(humanoidDescription)