Hello, I have a little question about my product code. For whatever reason, it doesn't grant me any profit.
Here's the code (In a server script):
local market = game:GetService("MarketplaceService")
local purchases = game:GetService("DataStoreService"):GetDataStore("Purchases")
function GetLocalGame(player)
return player:WaitForChild("PlayerGui"):FindFirstChild("game") --game is a ScreenGui
end
market.ProcessReceipt = function(receipt)
for _,v in pairs(game.Players:GetPlayers()) do
if v.userId == receipt.PlayerId then
local game = GetLocalGame(v):WaitForChild("product_function"):InvokeClient(v,receipt) --This RemoteFunction contains the code that runs when this product is purchased
purchases:IncrementAsync(tostring(v.userId) .. "::" .. tostring(receipt.ProductId))
print(v.Name," (",v.userId,") bought ",receipt.ProductId,"\n","info ",receipt.PurchaseId)
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted --Tell the market that the purchase has succeeded
end
The purchase was prompted in this code (LocalScript):
function testProduct()
game:GetService("MarketplaceService"):PromptProductPurchase(player,20336741,false,"Robux")
end
The product costs 10 Robux, but whenever anyone buys it, I get absolutely no profit (Points are added to the game budget though)
Thanks ~coo1o

1 comment
Oh, thanks for reminding me. I read this up a while ago but must've forgoten. Thanks again!