Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I fix this problem with my developer product gui?

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

1 answer

The path could be incorrect. Replace it with game.Players.LocalPlayer like you've written before.

This discussion is preserved as it was. New answers, comments, and votes are closed.