The error is: Unable to cast Instance to int64 Script:
1 | local ms = game:GetService(“MarketplaceService”) |
2 | local id = 13589927 |
3 |
4 | script.Parent.MouseButton 1 Click:Connect( function () |
5 | ms:PromptGamePassPurchase(id, game.Players.LocalPlayer) |
6 | end ) |
I’m using a GUI Textbutton to prompt a game pass purchase.
You need to do it the other way. The first Value is the Player, the second the ID. So just do:
1 | local ms = game:GetService(“MarketplaceService”) |
2 | local id = 13589927 |
3 |
4 | script.Parent.MouseButton 1 Click:Connect( function () |
5 | ms:PromptGamePassPurchase(game.Players.LocalPlayer, id) |
6 | end ) |