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

I want to make a brick that you can click to purchase a dev product. How can I do this ?

Hello I want to make a brick that i can click to buy a dev product. I tried it with this script but it doesnt work

script.Parent.MouseClick:Connect(function()
	game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer,1069575853)
end)

thanks for your help.

1 answer

✓ Accepted answer

Try this, and please use this script parented to a brick!

local ClickDetector = Instance.new("ClickDetector", script.Parent)
ClickDetector.Name = "\0" -- a clickdetector with no name
ClickDetector.MaxActivationDistance = 32 -- set the maxactivationdistance to 32 studs
ClickDetector.MouseClick:Connect(function(plr) -- establish a RBXScriptConnection.
    game:GetService("MarketplaceService"):PromptProductPurchase(plr, devProductId) -- change devProductId to ur devproductid.
end)

If this helps, please mark this as a solution.

Metatable out!

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