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

DevProduct isn't Prompting Purchase?

I'm basically trying to use a brick with a click detector to prompt a developer product purchase. This works in Studio but not on the actual server. What am I doing wrong here?

local buyBTN = script.Parent
local player = game.Players.LocalPlayer
local MarketplaceService = game:GetService('MarketplaceService')
local productId = 19181612

--Connects to block and MPS then, buys the product
function onClicked(buyBTN)
	MarketplaceService:PromptProductPurchase(player, productId)
end

script.Parent.ClickDetector.mouseClick:connect(onClicked)

1 answer

✓ Accepted answer

Server script:

local buyBTN = script.Parent
local MarketplaceService = game:GetService('MarketplaceService')
local productId = 19181612

--Connects to block and MPS then, buys the product
function onClicked(player)
    MarketplaceService:PromptProductPurchase(player, productId)
end

script.Parent.ClickDetector.MouseClick:Connect(onClicked)

Does this work? Haven't used DP in a while

1 comment

0

Thanks, it worked!

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