The main error isn’t the fact that the code was wrong, the main error was just that you need to put the ID of the gamepass, the ID you want the player to see when they click on the part.
To do this, you need to actually make a gamepass, then copy the ID off of the url it should just be a number like 1230424.
But it’s not a gamepass, I did insert a Id I just removed it to post it, it’s an in game purchase u can buy multiple times, I got the idea from game settings under monetization
What do you mean? Because you will call the PromptProductPurchase in the code, it will prompt you with the purchase UI that Roblox uses, and then you would be able to purchase / cancel it.
Is that what you mean? Or do you mean like how would you get to know if someone has purchased that product
For knowing if someone bought the product & then you want to give the player some kind of reward, you will have to use ProcessReceipts. You can have an overview of how to use it in the API reference:
Search how to detect when a part is touched. Use my code so you can prompt a purcharse. If you are a medium- advanced scripter, it should be easy to you to do this things.