How to check how many hats a player owns?

Hey, I’m looking to figure out how many hats (in their inventory) a player has, also, if their inventory is private or not.

If this is not possible, then I’d be looking to figure out how many outfits a player has.

Thank you for any help!

Hello,
This is currently not possible since Roblox has security settings on inventory viewability.
You can only do this if you have every hat id on roblox.

2 Likes

You might be able to work something out using the Roblox Inventory Api and querying based on userId, returning either a result or a 401(?) if their inventory is private.

If you plan to use it in-game, note that you’ll need to also use some sort of proxy, such as rprxy as Roblox does not allow developers to use their api from within the game.

1 Like

Thank you!
If you don’t mind me asking, as I’m very new to this, how’d I include this into a script for it to return a result?