How would I make a part click detector to prompt a developer product?

Hello, I am wondering on how I can make it so when you click a part it prompts a developer product to buy.

If you have a idea of this please dm me @Developer#8173

You should read about the PromptPurchase function?

Try read about PromptPurchaseFinished if you want to do something “if” they purchase your developer product. It should be helpful.

I’m actually not completely sure as I always work with gamepasses but I’m pretty sure it’s something similar or the same?

Whenever I prompt gamepasses for players clicking something in the game it would look like this:

script.Parent.ClickDetector.MouseClick:Connect(function(Player)
	game:GetService("MarketplaceService"):PromptGamePassPurchase(Player, GAMEPASS_ID)
end)
3 Likes

Thank you, appreciate the help!

If gothiu’s answer worked for you, please remember to mark their response as the solution.

2 Likes

The correct function to use specifically for Developer Products is PromptProductPurchase. PromptPurchase is only used for standard assets.

@Aatlxs_Dev In the future, please search these kinds of things up before posting threads. Scripting Support is not a location to ask for free code. This is a question you could answer by having searched first.

2 Likes

I made a Script for everyone found in this Thread, feel free to take it!

It has exactly what you are looking for and a few more features.

I strongly disagree;

Their choice to learn or not to learn is their’s to be chosen I don’t care which, I simply supply them with the materials to be used in whatever way they desire to do so thus the purpose of creating those Scripts.

If the OP wanted to learn they wouldn’t have made this thread, there are countless resources related to the same topic on the Internet that can be easily found.

1 Like

Sorry thank you to all of your responses, this is my first post on the support section so I may have made mistakes.

1 Like