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

I asked how to get a button were if you click it it shows a buy popup?

Asked by 5 years ago

I got a codeing thing so if any of you guys can help me add me on discord so you you can do it i REALY need help discord ThinksushYT#7641

the code is

"local id = 16630147--change it to your own id local textbutton = --locate it here by your own local plr = game.Players.LocalPlayer --locating the local player

textbutton.MouseButton1Click:Connect(function()--an event which occurs when the player clicks the button game:GetService("MarketplaceService"):PromptPurchase(plr, id) --popping up a prompt purchase end)" Plz help

1 answer

Log in to vote
0
Answered by
chomboghai 2044 Moderation Voter Community Moderator
5 years ago

If you want it to prompt a game pass purchase, use PromptGamePassPurchase instead of PromptPurchase. Then, the first argument will be the player, and the second will be the game pass ID.

textbutton.MouseButton1Click:Connect(function()

    -- this is what you have
    game:GetService("MarketplaceService"):PromptPurchase(plr, id)

    -- change it to this
    game:GetService("MarketplaceService"):PromptGamePassPurchase(plr, id)

Hope this helps! :)

Ad

Answer this question