The script lets you buy the product through the gui but it does not give Cash and I am stumped on why not.
Here is the script:
local buyButton = script.Parent local productId = 19217377 local mps = game:GetService"MarketplaceService" function getPlayerById(id) for i,v in pairs(game.Players:GetPlayers()) do if v.userId == id then return v end end end buyButton.MouseButton1Click:connect(function() mps:PromptProductPurchase(game.Players.LocalPlayer, productId) end) mps.ProcessReceipt = function(info) local player = script.Parent.Parent.Parent.Parent.Parent local money = player.leaderstats.Cash money.Value = money.Value + 500 end
The path could be incorrect. Replace it with game.Players.LocalPlayer like you've written before.