Hello, currently I am trying to make dev products for currency but whenever i try to test purchase them it shows this
here are the two scripts:
this is the ServerScript
local ProductToQuantity = {
[2613977068] = 100,
[2613977030] = 250,
[2636797427] = 500,
}
local function processReceipt(receiptInfo)
local productId = receiptInfo.ProductId
local quantity = ProductToQuantity[productId]
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if player then
local Leaderstats = player:WaitForChild("leaderstats")
local Leaderstat = Leaderstats:FindFirstChild("Time") -- Change Coins to whatever your currency is
Leaderstat.Value = Leaderstat.Value + quantity
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
game:GetService("MarketplaceService").ProcessReceipt = processReceipt
this is the client
local ShopChildren = script.Parent:GetChildren()
local MarketplaceService = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
for _, button in pairs(ShopChildren) do
if button:IsA("TextButton") or button:IsA("ImageButton") then
button.MouseButton1Click:Connect(function()
local gamePassID = button.DevID.Value
MarketplaceService:PromptGamePassPurchase(player, gamePassID)
end)
end
end
basically im seeing which button is pressed with the product ID inside then the server sees which ID then it gives that currency
any help is appreciated!