DevProduct Purchase Error

Hello.

I’m working on a donation system for a game, and there’s a list of Robux amounts that the player can choose from (shown below).

image

Each button is to prompt the player to purchase a corresponding developer product, but the “25 Robux Donation” isn’t working. I’m not sure why. The code is the same for each button with the exception of their respective IDs.

Code
local MarketplaceService = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local id = 1118524989

script.Parent.MouseButton1Click:Connect(function()
	MarketplaceService:PromptProductPurchase(player, id)
end)

Whenever I click it, the prompt tells me that it’s not on sale.

To my knowledge, a developer product can’t be offsale. There isn’t an option to disable sales.

I’m using the correct ID, too.

image

I’m stumped. Does anyone have any ideas as to why this might be happening?

Thank you.

3 Likes

Are you sure there isn’t another LocalScript in that button?

3 Likes

This could be an issue with the product itself, if you haven’t already checked and confirmed that the dev product is for sale then here are some solutions you could try:

  • Make a new dev product and try that
  • Confirm that the ID you use is the correct ID
3 Likes

I’m sure.

image

3 Likes

As mentioned in my post, there isn’t an option to disable sales for developer products. I attached my code and a screenshot of the developer product’s details to show that I’m using the correct ID.

I plan to use the first solution if all else fails, but I’m trying to solve the original issue instead of avoiding it.

2 Likes

Your code works for me, not sure why it isn’t working for you

2 Likes

I tried your code and it worked for me so I would recommend just making another product of the same details could just be a roblox glitch, Hope this helps

2 Likes

If you put it into a normal textbutton (without connecting it to the board) does it still give the same problem? Otherwise, I’d see if just making a new devproduct fixes it.

1 Like

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