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)
LocalScripts don't run in Workspace, since the server is unable to identify which client(s) to run them on. Move the code to a server script and find a different way to identify the player.