I have tried to change the ID, and I have checked the forums but have not found anything.
Down below is the LUA code, is there any errors shown? Did I do something wrong.
ContentSF_Money.TenThousand.MouseButton1Up:Connect(function(plr)
MarketplaceService:PromptProductPurchase(plr, TenThousandID)
if MarketplaceService.PromptPurchaseFinished then
Money = Money.Value + 10000
end
end)
Without the value adding part of the script, the error still occurs. Does it have something to do with the prompting part of the script? It is a int value btw.
game:GetService("MarketplaceService").PromptProductPurchaseFinished:Connect(function(uid, pid, success)
if success then
local plr = game.Players:GetPlayerByUserId(uid)
if pid == TenThousandID then
plr.leaderstats.Money.Value+=10000
end
end
end)
this is how to correctly add money to a leaderstat if the player purchases a dev product
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local TenThousandID = put your id here
MarketplaceService.ProcessReceipt = function(receiptInfo)
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if receiptInfo.ProductId == TenThousandID then
player.leaderstats.Money.Value += 10000
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
Local script:
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local TenThousandID = put your id here
local localPlayer = Players.LocalPlayer
ContentSF_Money.TenThousand.MouseButton1Up:Connect(function()
MarketplaceService:PromptProductPurchase(localPlayer, TenThousandID)
end)