Hiding all face accessories?

Hi all,

I want to hide the LocalPlayer’s humanoid’s face accessories, but only on the client.
It doesnt work with LoadHumanoidDescription as that is only for the server and I dont know how to tell apart a face accessory from any other accessory so it only hides the face accessory. I’ve read that LoadHumanopidDescription has no client-side work arounds, so how can I tell apart a face accessory from any other?

Off the top of my head, I can’t really think of a method to determine whether it is or is not a face accessory.

It may be worth checking if the Welds of the accessories correspond to the facial area and if so, deleting them.

I’m away from my PC at the moment and cannot offer a 100% accurate method.

Edit: it may actually be easier to just remove server side.

1 Like

All face accessories have an attachment named “FaceFrontAttachment” parented to the handle part of the accessory.
image
image

Here is a script:

function isFaceAccessory(accessory)
    local handle = accessory:FindFirstChild("Handle")

    if accessory:IsA("Accessory") and handle:FindFirstChild("FaceFrontAttachment") ~= nil then
        return true
    else
        return false
    end
end
5 Likes

The if statement wouldn’t be necessary. You can return the evaluation of a statement. You can return the result of a FaceFrontAttachment search in the accessory and if there is one, it’ll return true, otherwise false. The accessory check should be handled outside of this function as well.

If you want to get really specific and avoid class-checking, the Humanoid has a great method called GetAccessories which, as you can probably tell from the title, allows you to fetch all the hats a user is wearing. This will return any hats either on the accessory or legacy hat system.

for _, accessory in ipairs(humanoid:GetAccessories()) do
    if accessory:FindFirstChild("Handle") and accessory.Handle:FindFirstChild("FaceFrontAttachment") then
        accessory.Handle.LocalTransparencyModifier = 1
    end
end
3 Likes