Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is this text button not prompting a product purchase?

local MPS = game:GetService("MarketplaceService")

script.Parent.MouseButton1Click:Connect(function(player)
	MPS.PrompProductPurchase(player, 438867189)
end)

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)

2 comments

2

^ also make sure its a localscript

0

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.

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.