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

How do I make a button that you can click, that lets you make in-game purchases?

Asked by 10 years ago

(Like Kestrel, not a drop down)

2 answers

Log in to vote
0
Answered by
Xianon 105
10 years ago
local PassId = script.Parent.Parent.Parent.Parent.Settings.PassId.Value 

script.Parent.MouseButton1Click:connect(function(player)
    Game:GetService("MarketplaceService"):PromptPurchase(player,PassId)
end)


script.Parent.Text = "Purchase " .. script.Parent.Parent.Parent.Settings.PassName.Value
Ad
Log in to vote
0
Answered by 4 years ago

Hi. first make a Text Button I recommend you go a test and make a DevProduct than insert this into a local script inside the text-button:

MPS = game:GetService("MarketplaceService")
id = 653936051 
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
    MPS:PromptProductPurchase(player, id)
end)

Answer this question