Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why won't it show the purchase? -The answer didn't work-

local MarketplaceService = game:GetService("MarketplaceService")
local buyButton = game.Workspace.BuyButton.SurfaceGui.TextButton
local productId = 21248921

buyButton.MouseButton1Click:connect(function()
    MarketplaceService:PromptProductPurchase(game.Players.LocalPlayer)
end)

When you click the GUI it won't show the purchase. (Like stated in the title)

3 answers

✓ Accepted answer

You left out the productId in PromptProductPurchase.

4 comments

0

It is MarketplaceService:PromptProductIdPurchase(game.Players.LocalPlayer)

0

right?

0

It won't work

0

"You LEFT OUT the productId"

local bloxyColaId = 114842687 local player = game.Players.LocalPlayer

function onClick() game:GetService("MarketplaceService"):PromptPurchase(player, bloxyColaId) end

script.Parent.MouseButton1Click:connect(onClick)

-- Try that, you also need to add it into a Gui.

1 comment

0

:/ It didn't work

@CyanSparkleTime

local bloxyColaId = 21248921 local player = game.Players.LocalPlayer

function onClick() game:GetService("MarketplaceService"):PromptPurchase(player, bloxyColaId) end

script.Parent.MouseButton1Click:connect(onClick)

It didn't work ;c

This discussion is preserved as it was. New answers, comments, and votes are closed.