local buyButton = script.Parent local productId = 20495307 local mps = game:GetService"MarketplaceService" buyButton.MouseButton1Click:connect(function() mps:PromptProductPurchase(script.Parent.Parent.Parent.Parent.Parent, productId) print("Prompt Purchase") end) mps.ProcessReceipt = function(info) local plr = script.Parent.Parent.Parent.Parent.Parent if plr and plr:FindFirstChild"leaderstats" and plr.leaderstats:FindFirstChild"Coins" then plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + 1000 print(plr.Name.." got the purchase.") return Enum.ProductPurchaseDecision.PurchaseGranted end end
It gives the purchase and coins but the coins go to a random player rather than the customer who paid for it. If you see an error, please correct me!
Here take this script and edit it. I made it simple with notes so you would know what to do. :) If this helps you help Thumbs it up and say it gave you a answer!
http://www.roblox.com/Dev-Product-Stats-item?id=166267560
Just copy and paste then take it.