It won't work and I have absolutely no idea why! It debugs when you click it but other than that
local productId = script.Parent.Name local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() print ("debug") game:GetService("MarketplaceService"):PromptGamepassPurchase(player, productId) end)

1 comment
Fix your code blocks to make the code easier to read; you can click the preview button before posting your question to see what the question will look like.