I have some code that checks if the player bought the product and awards them the proper amount of credits, I went to test this, yet I did not receive the credits like it should've given me.
Processing Script:
local MarketPlace = game:GetService("MarketplaceService") local DataStore = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory") local Product = 24670894 local give = 50 MarketPlace.ProcessReceipt = function(ReceiptInfo) for i, Player in ipairs(game.Players:GetChildren()) do if Player.userId == ReceiptInfo.PlayerId then if ReceiptInfo.ProductId == Product then local stat = Player:WaitForChild("leaderstats") stat.Credits.Value = stat.Credits.Value + give end end end local PlayerProductKey = "player_" .. ReceiptInfo.PlayerId .. "_purchase_" .. ReceiptInfo.PurchaseId return Enum.ProductPurchaseDecision.PurchaseGranted end
Prompt Purchase Script:
local Product = 24670894 local MarketPlace = game:GetService("MarketplaceService") script.Parent.MouseButton1Down:connect(function(Player) MarketPlace:PromptProductPurchase(game.Players.LocalPlayer, Product) end)