As you might already know from my earlier post, I'm making an ATM machine that gives money when buying a developer product. I already scripted all 6 of the cash values that you can buy in my game but I don't know how to give the players money when purchasing it. The leaderstats and prompt is all done.
You can use return Enum.ProductPurchaseDecision.PurchaseGranted
to make sure that the player bought your DevProduct.
Example code:
game:GetService("MarketplaceService").ProcessReceipt = function(purchaseInfo) local plr = game:GetService("Players"):GetPlayerByUserId(purchaseInfo.PlayerId) --Defines the player who bought the product if purchaseInfo.ProductId == 828036387 then --Replace with your product ID plr.leaderstats.Cash.Value = plr.leaderstats.Cash.Value + 1000 --Cash to be given end return Enum.ProductPurchaseDecision.PurchaseGranted --Makes sure the player has bought the DevProduct end
Hope this helps!
Closed as Not Constructive by hiimgoodpack and Torren_Mr
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?