local MarketplaceService=game:GetService("MarketplaceService") local devproductid=52874408 MarketplaceService.ProcessReceipt = function(receiptInfo) for i,player in ipairs(game.Players:GetChildren()) do if receiptInfo.ProductId == devproductid then player.Credits.Value = player.Credits.Value + 100 end end return Enum.ProductPurchaseDecision.PurchaseGranted end
This is supposed to give 100 credits to the player, however, when tested in the actual game it doesn't give the player credits. It works in normal mode however
Here is a dev product script that you can use for any dev product you just have to change what should be done if all requirements are met. I've edited it to suit your needs so you can just copy and paste it but i do suggest you go through it and see what does what and why it's suppose to be that way
local MarketplaceService = game:GetService("MarketplaceService") local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory") local productId = 52874408 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.Credits.Value = player.Credits.Value + 100 end end end local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.ProductId ds:IncrementAsync(playerProductKey, 1) return Enum.ProductPurchaseDecision.PurchaseGranted end