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

DialogChoice prompting in-game purchase?

Asked by
iSEANxo -1
7 years ago

I'm trying to make a script which prompts a purchase when a specific choice is selected. The below script is a local script and I can't figure out why it doesn't work.

script.Parent.DialogChoiceSelected:connect(function(player, choice)
local id = 000000 --example
local player = game.Players.LocalPlayer

    if choice.Name=="A" then
        wait(1)
            game:GetService("MarketplaceService"):PromptPurchase(player, id)
        end
end)

Anyone have any advice/suggestions?

1
Finding the player via LocalPlayer isn't needed since DialogChoiceSelected already returns the player as the first parameter. Troidit 253 — 7y
0
Also id is 000000, which isn't anything... thehybrid576 294 — 7y

Answer this question