karlo_tr10 gave me a code to increase players currency which will work with the purchase button script for Dev product. Is there a purchase script to trigger a purchase?
You can prompt a purchase for players to purchase a gamepass or some other dev product, but you cannot force someone to purchase a the product. That is up to them.
Although, if you want to bring up the purchase prompt and don't know how, this is how you'd do that:
-- *****This code should be within a 'LocalScript' object**** local MarketplaceService = game:GetService("MarketplaceService") local Players = game:GetService("Players") local productID = 0000000 -- Change this to your developer product ID -- Function to prompt purchase of the developer product local function promptPurchase() local player = Players.LocalPlayer MarketplaceService:PromptProductPurchase(player, productID) end --function for when the player clicks a button goes here.... promptPurchase() --end of button click function