Hello!
I am trying to get my leaderstat "Purchases" to increase when a player buys something in my store:
local mpService = game.getService("MarketplaceService")
mpService.ProcessReceipt = function(purchaseInfo)
local plr = game.getService("Players"):GetPlayerByUserId(purchaseInfo.PlayerId)
if purchaseInfo.ITEM_ID == 123456 then
--The value that will be incremented
local Purchases = plr.leaderstats.Purchases;
Purchases.Value = Purchases.Value +1
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
I put 123456 as a placeholder, but it would be the actual ID of the clothing item being purchased.
Any help would be appreciated, TY

1 comment
Any ideas?