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
1local MPS = game:GetService("MarketplaceService")
2 
3script.Parent.MouseButton1Click:Connect(function(player)
4    MPS.PrompProductPurchase(player, 438867189)
5end)

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
1local MPS = game:GetService("MarketplaceService")
2local player = game.Players.LocalPlayer
3 
4script.Parent.MouseButton1Click:Connect(function() --does not return any parameters
5    MPS:PrompProductPurchase(player, 438867189) --colon to signify you're calling a method
6end)
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