Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I remove player accessoires but keep their hair?

Asked by 4 years ago

I want the script just to remove their hats but keep the hair.

0
They are all accessories, so you'll have to go find a way to check the ID and see if it's hair or a hat. MrLonely1221 701 — 4y
0
How am I suppose to do that? I've never done anything like that before. Justingamer700 114 — 4y
0
I don't think it's possible. niroqeo 123 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

This can be done with HumanoidDescriptions.

-- access the character and humanoid
local character = workspace:WaitForChild("username")
local humanoid = character:WaitForChild("Humanoid")

-- access the previously existing HumanoidDescription
local HumanoidDescription = humanoid.HumanoidDescription

-- set the value of every non-hair accessory to an empty string
HumanoidDescription.BackAccessory = ""
HumanoidDescription.FaceAccessory = ""
HumanoidDescription.FrontAccessory = ""
HumanoidDescription.HatAccessory = ""
HumanoidDescription.NeckAccessory = ""
HumanoidDescription.ShouldersAccessory = ""
HumanoidDescription.WaistAccessory = ""

-- reapply the humanoid description
humanoid:ApplyDescription(HumanoidDescription)
1
It works! Thanks Justingamer700 114 — 4y
Ad

Answer this question