local MarketplaceService = game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("countdowncreditservice")
local productID = 23394060
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.statistics.credits.Value = player.statistics.credits.Value + 50
local key = "plyr-"..player.userId
local savedvalue = {player.statistics.credits.Value}
ds:SetAsync(key, savedvalue)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
The ID is correct, I'm getting no errors. This is supposed to process the receipt. I don't understand what the problem is.

2 comments
This is really important.
I don't know how expensive this is to test (can you make a free test product?), but if it's cheap/free, I'd put in a bunch of print statements to explain 1. what lines the script is running, and 2. what the values of variables are (to explain why 'if' statements might be returning false when you don't expect them to). Press F9 for developer console to see the output if testing online.