Dev product purchase not working

I’m trying to prompt a dev product purchase in my game. The dev product is under another game and it gives me an error on purchase even though third party sales are enabled. It also works in studio just not in game. Thanks.

1 Like

Could you maybe provide the code and a bit more information…

I can’t provide any more info its already explained pretty well here is the code:

local skins = require(game.ReplicatedStorage.Skins)

script.Parent.MouseButton1Click:Connect(function()
	game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, skins.GetPurchaseId(1))
end)

Is it possible to show me the module and the error?

This is the error:

foto_no_exif(6)

It has nothing to do with the code its something I prolly need to enable somewhere.

This is the module:

local pids = {
	1144395734,
	1131836704,
	1131836731,
	1131836747,
	nil,
	1132010940
}

function module.GetPurchaseId(num)
	return pids[num]
end
local pids = {
	1144395734,
	1131836704,
	1131836731,
	1131836747,
	nil, -- why is this here?
	1132010940
}

function module.GetPurchaseId(num)
	return pids[num]
end

For clarification, Third Party Sales are enabled from Game Settings and not Workspace right?

Yes they are enabled in game settings.

Well, if it was able to get the item’s name, then it found the developer product, do you have a function for the ProcessReceipt binded? It’s probably trying to call the function but realizing that nothing is there

You can not sell developer products from another game.

1 Like

Why not I have third party sales enabled?

You can only sell developer products in its game, but you can sell assets and game passes from any game as long as you have enabled third-party sales.

What should I do instead then cause I still need to be able to sell these items across multiple games.

Create developer products for each game.

Is it necessary that you have concurrency between 2 different games? I am assuming that just having 2 places under the same game is not going to solve the issue here.

If the purchase is going to be a one time thing then just use a gamepass, if not then the only hacky option I can think of is hosting your own db and storing purchase records there.