Finding the ID of an accessory in game

I’m currently making a whitelist array for hats that players are allowed to wear, where you add the id of the hat id into an array.

How would I check what the id of the hat a player is wearing is?

You can cycle through the children of a character and check the accessory’s Mesh ID. You’ll need to store the mesh IDs, you can also store Mesh/Texture ID combos, or try using the InsertService to be able to compare instances (although in the character it can be modified by the physics/character systems)

Unsure of a better solution or how you’d properly enforce this (other than just removing the hat)

Are you saying I should use the meshid in the array instead of the hat id in the catalog?

You can implement a custom loading system so that you can make adjustments to players’ HumanoidDescription before loading their characters.

It should be easy to find non-whitelisted id’s on HumanoidDescriptions, and replace them with desired defaults.


This worked, thank you!


1 Like