Developer Product not working

I am trying to create a developer product that gives the player a tag which displays how much robux the player has donated, and gives the player a tag in chat. Currently I’m just trying to make the script actually work first.

local MarketPlaceService = game:GetService("MarketplaceService")
local gui = game:GetService("StarterGui")
local players = game:GetService("Players")

local productID = 1367741903

local function processReceipt(receiptInfo)
	local player = players:GetPlayerByUserId(receiptInfo.PlayerId)
	if not player then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	if receiptInfo.PurchaseId == productID then
		if player then
			print("This Works") --I just want to make sure it works first, so im printing.
		end
	end
end

MarketPlaceService.ProcessReceipt = processReceipt

This doesn’t work, no errors in console.

I gotta tell you something, from what I know, you are not allowed to display personal info of a player in game, and if I’m not wrong Robux are part of it, so you would t be able to do that, unless with Rovuz you mean an in game currency, in that case change the name because you can’t use names like Robux or Roblox

I dont think this is entirely accurate from what I’ve seen. You should be fine, I’m seen games display this on donation boards and on nametags which is similar to what he is doing.

But to answer your question @BatmanTheBeast190, I suggest using the documentation.
https://developer.roblox.com/en-us/api-reference/callback/MarketplaceService/ProcessReceipt

You are using receiptInfo.PurchaseId when you should be using receiptInfo.ProductId.

PurchaseId is the unique identifier for the specific purchase.

I meant how much the player has donated, sorry for the confusion

Did this end up fixing your issue?

Yes, I removed the check for the productId being the correct one, which worked but is there a way to check this correctly?

Oh ok, the. You’re okay.

You would use this.

local MarketPlaceService = game:GetService("MarketplaceService")
local gui = game:GetService("StarterGui")
local players = game:GetService("Players")

local productID = 1367741903

local function processReceipt(receiptInfo)
	local player = players:GetPlayerByUserId(receiptInfo.PlayerId)
	if not player then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	if receiptInfo.ProductId == productID then
		if player then
			print("This Works") --I just want to make sure it works first, so im printing.
		end
	end
end

MarketPlaceService.ProcessReceipt = processReceipt

Oh yeah I’m stupid, thanks for the help. I’ll mark yours as the answer.

Thanks for the notice, I might have made a big mistake otherwise!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.