This script is used in a text Button on a surfacegui but when it is clicked, nothing happens.
local id = 605471096
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Down:connect(function()
game:GetService("MarketplaceService"):PromptPurchase(plr, id)
end)

4 comments
LocalPlayer only works in local scripts.
Put print("Running") at the top of the script and see if it is running.
Except that it's in a SurfaceGui.
it is a local script