1 | local MPS = game:GetService( "MarketplaceService" ) |
2 |
3 | script.Parent.MouseButton 1 Click:Connect( function (player) |
4 | MPS.PrompProductPurchase(player, 438867189 ) |
5 | end ) |
1 | local MPS = game:GetService( "MarketplaceService" ) |
2 | local player = game.Players.LocalPlayer |
3 |
4 | script.Parent.MouseButton 1 Click:Connect( function () --does not return any parameters |
5 | MPS:PrompProductPurchase(player, 438867189 ) --colon to signify you're calling a method |
6 | end ) |
So take your surface gui, put it in starter gui. Set the surface gui's adornee to the part. After that, put this local script into the button.
local player = script.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:Connect(function() game.MarketplaceService:PromptProductPurchase(player,438867189)
end)