Clothing Purchases From Roblox Group Shown On Leaderboard

Hello, developers! :smiley:
I want to make a value on the leaderboard that shows how many clothing purchases a player made from my Roblox group.

The problem is I seem to fail doing that, I am stuck on the part as to how to check how many clothing purchases a player made from the group and to display it on the leaderboard.

Here is an example of my code:

function added(player)
	local ls ="IntValue")
	ls.Name = "leaderstats"

	local role ="StringValue")
	role.Name = "Purchases"

	role.Value = player:GetStorePurchasesInGroup8161349)

	ls.Parent = player
	role.Parent = ls

So I guess the main problem is how do I identify the store purchases from a player in a group?

i think a similar topic was created a while ago, here you go

basically you get the player’s inventory through HTTPService and loop through it, checking each clothing’s creator id is your group’s id

There you go. Problem solved : )

This is SCRIPTING SUPPORT it doesn’t mean that they are causing ‘clutter’

what? i didn’t say this was a duplicate topic, i just gave OP an idea of how to get clothing purchases from a player

I did this line of code:

role.Value = player:GetStorePurchasesInGroup(8161349)
But it did not work, how do I make the value of the role be the amount of purchases a player has from a certain group?

Did you check the Wiki because I honestly am seeing that function for the first time.