Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why doesn't this Product code grant me profit?

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 answer

✓ Accepted answer

Money made from products are held as Pending Sales in your Money tab. You'll receive the money in a couple days.

1 comment

0

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

This discussion is preserved as it was. New answers, comments, and votes are closed.