local button = script.Parent.Purchase local mpService = game:getService("MarketplaceService") button.MouseButton1Click:connect(function() mpService:PromptProductPurchase(game.Players.LocalPlayer, 335171701) end)
This script is a localscript inside of a text button that is the child of a screenGUI.
This should work, If it does please accept my answer:)
local button = script.Parent.Purchase local mpService = game:getService("MarketplaceService") script.Parent.MouseButton1Down:connect(function() mpService:PromptProductPurchase(game.Players.LocalPlayer, 335171701) end)