Hello, whenever I make a test purchase of a developer product, it doesn’t give the coins that it should or does anything really.
ProcessReceipt Script:
local MarketService = game:GetService("MarketplaceService")
local Players = game.Players
local Coins1000ProductID = 1257555750
local Coins5000ProductID = 1257555831
local Coins10000ProductID = 1257555944
local function processReceipt(receiptInfo)
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
local playerchar = game.Workspace:FindFirstChild(player.Name)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if receiptInfo.ProductId == Coins1000ProductID then
if player then
playerchar.CoinsValue.Value = playerchar.CoinsValue.Value + 1000
print(player.Name.." bought 1000 coins!")
end
end
if receiptInfo.ProductId == Coins5000ProductID then
if player then
playerchar.CoinsValue.Value = playerchar.CoinsValue.Value + 5000
print(player.Name.." bought 5000 coins!")
end
end
if receiptInfo.ProductId == Coins10000ProductID then
if player then
playerchar.CoinsValue.Value = playerchar.CoinsValue.Value + 10000
print(player.Name.." bought 10000 coins!")
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
MarketService.ProcessReceipt = processReceipt()
One of the Dev products prompt purchase (local script):
local parent = script.Parent
local MarketService = game:GetService("MarketplaceService")
local ProductID = 1257555750
local player = game.Players.LocalPlayer
parent.MouseButton1Click:Connect(function()
MarketService:PromptProductPurchase(player, ProductID)
end)