local MPS = game:GetService("MarketplaceService")
script.Parent.MouseButton1Click:Connect(function(player)
MPS.PrompProductPurchase(player, 438867189)
end)
COMMUNITY QUESTION
Why is this text button not prompting a product purchase?
2 answers
local MPS = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function() --does not return any parameters
MPS:PrompProductPurchase(player, 438867189) --colon to signify you're calling a method
end)
So take your surface gui, put it in starter gui. Set the surface gui's adornee to the part. After that, put this local script into the button.
local player = script.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:Connect(function() game.MarketplaceService:PromptProductPurchase(player,438867189)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
^ also make sure its a localscript
Just did this in a local script, still doesnt work. No errors or anything. Its a text button on a surface gui if that matters.