I tried to make a UI where you can buy extra coins using robux
it finishes the purchase but does not add any points
ServerscriptService script:
local mps = game:GetService("MarketplaceService")
local id = 1235674804
local id2 = 1235674834
local id3 = 1235674863
local function processReciept(receiptInfo)
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if player then
if receiptInfo.ProductId == id then
player.leaderstats.points.Value = player.leaderstats.Points.Value + 100
end
if receiptInfo.ProductId == id2 then
player.leaderstats.points.Value = player.leaderstats.Points.Value + 1000
end
if receiptInfo.ProductId == id3 then
player.leaderstats.points.Value = player.leaderstats.Points.Value + 1500
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
Textbutton script:
--1235674804
local mps = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local id = 1235674804
script.Parent.MouseButton1Click:Connect(function()
mps:PromptProductPurchase(player, id)
end)
This script is in all the three buy buttons with different id’s
No errors just it won’t add money
Leaderstats value: