I've been trying to look up this question on Google and Youtube trying to find a video or something on this subject. But all I'm finding is videos that use the old "GamepassService", instead of "MarketPlaceService". Is there anyone that could help a brother out on this subject cause I'm completely lost at this point lol.
You can use PromtGamePassPurchase and put it into a mouseclick or mousebutton1down event function (depending on whether or not you use a GUI). I would also recommend checking the Object Browser for MarketplaceService if you want to put other in-game purchases into your game because this example only works with game passes.
local mps = game:GetService("MarketplaceService") local gpid = -- Insert ID Here script.ScreenGui.ResetOnSpawn = false game.Players.PlayerAdded:Connect(function(player) mps:PromptGamePassPurchase(player, gpid) -- game pass ID can also go here end)