I don't see any errors it but doesn't work. There is the script:
function Click() local players = game.Players.LocalPlayer local id = 327347843 local p = game:GetService("MarketplaceService"):PromptProductPurchase(players, id) if money == players:FindFirstChild("leaderstats"):WaitForChild("Money") then if money == p then money.Value = money.Value + 2 end end script.Parent.MouseButton1Click:Connect(Click)
MarketplaceService is a thing that needs to be done through ServerScript(AKA. Normal Script) but looks like you are trying to access it via LocalScript.--- Although, if you are using a normal script, ServerScripts can't reach game.Players.LocalPlayer
because there is no such property named "LocalPlayer" for server.
EDIT: Looks like it can be accessed via LocalScript too. Can you describe what actually doesn't work in your code so we can help? You can use prints and/or breakpoints to see what is wrong.