this is what I have and it doesn't work. no errors or anything. the script is a local script inside the text button in the surface gui that is in workspace.
local id = 11294323
local player = game.Players.LocalPlayer
local MS = game:GetService("MarketplaceService")
script.Parent.MouseButton1Click:connect(function(mouse)
print("clicked")
MS:PromptGamePassPurchase(player, id)
end)

2 comments
Make sure you have third party services enabled in studio, or else it won't work
do you mean third party purchases? because if so thats already enabled