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.
1 | local mps = game:GetService( "MarketplaceService" ) |
2 | local gpid = -- Insert ID Here |
3 |
4 | script.ScreenGui.ResetOnSpawn = false |
5 |
6 | game.Players.PlayerAdded:Connect( function (player) |
7 | mps:PromptGamePassPurchase(player, gpid) -- game pass ID can also go here |
8 | end ) |