Hi, I have made a leaderstats value for ‘donated’ and I want to make it so that when the player purchases a gamepass, it adds to the ‘donated’ value.
I have got about 10 buttons, which all link the player to purchasing a t-shirt. Under each button I have a local script saying:
local id = 11397896147
script.Parent.MouseButton1Click:Connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, id)
end)
How would I add to this script to make it so that it can detect if the player actually bought the t shirt and then add to the leaderstats value?