I was testing out my game on DevProduct, but It does not seems to work. I tried on my other games work but this doesn’t. Here is the script-
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
MarketplaceService.ProcessReceipt = function(receiptInfo)
if receiptInfo.ProductId == 1071863336 then
local Player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if Player then
repeat wait() until workspace:FindFirstChild(Player.Name) -- Just for safety.
local Character = workspace[Player.Name]
Player.leaderstats.Stage.Value += 1
return Enum.ProductPurchaseDecision.PurchaseGranted
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
end
end
script.Parent.MouseButton1Click:Connect(function()
if game.Players.LocalPlayer.leaderstats.Stage.Value < 90 then
game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer,1071863336 )
else
script.Parent.Text = "You are at the maximum stage."
wait(2)
script.Parent.Text = "Skip Stage"
end
end)