Hi guys! I have tried really hard to get this working and still cannot fix it :/ I would really appreciate it if you could help me! Thanks!
Any ideas why this isn't awarding the 100 coins? The transaction goes through fine.
Script in gui button :
local MarketplaceService = game:GetService("MarketplaceService")
local productId = 25851870
MarketplaceService.ProcessReceipt = function(receiptInfo)
for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then
if receiptInfo.ProductId == productId then
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 100
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
end
end
localscript in starterpack:
wait(1)
local stuff = game.Players.LocalPlayer.PlayerGui.ShopGUI.ShopFrame.Page7.Descriptions1.Buynow
local productId = 25851870 -- change to your developer product ID
stuff.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId)
end)

2 comments
Thanks! The transaction goes through but it doesn't award the coins though :/
Are you using a remote event? Set up an event and make sure you get the data store service.