Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why is this text button not prompting a product purchase?

Asked by
Azuc 112
6 years ago
local MPS = game:GetService("MarketplaceService")

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

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
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
^ also make sure its a localscript Imperialy 149 — 6y
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. Azuc 112 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

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)

Answer this question