I have this to give a developer product that is meant to give 5000 cash but it wont work. It will buy but not give the cash any help please?
id = 20566241 --dev product id
script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, id)
local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
MarketplaceService.ProcessReceipt = function(receiptInfo)
if game.Players.LocalPlayer.userId == receiptInfo.PlayerId then
if receiptInfo.ProductId == id then
game.Players.LocalPlayer.leaderstats.Money.Value = game.Players.LocalPlayer.leaderstats.Cash.Value + 5000
end
end
-- record the transaction in a Data Store
local playerProductKey = receiptInfo.PlayerId .. "_got_" .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)
-- tell ROBLOX that we have successfully handled the transaction
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end)

2 comments
No that was a different problem
Why was this voted down???