I've got a simple script that when it is clicked it will prompt a product purchase. Here is a sample code for a R$10 purchase.
productId = 33054891
script.Parent.ClickDetector.MouseClick:connect(function(plr)
game:GetService("MarketplaceService"):PromptProductPurchase(plr, productId)
end)
script.Parent.ClickDetector.MouseHoverEnter:connect(function()
script.Parent.SurfaceGui.Ammount.TextTransparency = 0.5
script.Parent.SurfaceGui.Sign.TextTransparency = 0.5
script.Parent.Enter.TextLabel.Visible = true
end)
script.Parent.ClickDetector.MouseHoverLeave:connect(function()
script.Parent.SurfaceGui.Ammount.TextTransparency = 0
script.Parent.SurfaceGui.Sign.TextTransparency = 0
script.Parent.Enter.TextLabel.Visible = false
end)
Thank you in advance.

5 comments
I think you just have to call PromptProductPurchase from the player, rather than the server. http://wiki.roblox.com/index.php?title=Developer_product
Didn't work.
Is it within a GUI or a part..?
Part
Is this a LocalScript or a regular script?