local MPS = game:GetService("MarketplaceService") script.Parent.MouseButton1Click:Connect(function(player) MPS.PrompProductPurchase(player, 438867189) end)
local MPS = game:GetService("MarketplaceService") local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() --does not return any parameters MPS:PrompProductPurchase(player, 438867189) --colon to signify you're calling a method 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)