What I want to get are two skipstage one of skipstage 1 and another of skipstage2
First when i have skipstage 1 it works but when i add else if and copy and paste it doesn’t work anyone know what’s wrong? and to add I did not get any error in the output
script(server script service) :
local skip1 = 972768947
local skip2 = 972768973
local MarketplaceService = game:GetService("MarketplaceService")
local function processReceipt(receiptInfo)
local player = game:GetService("Players"):GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
print(receiptInfo.PlayerId .. " just bought " .. receiptInfo.ProductId)
local sound = Instance.new("Sound", player)
sound.SoundId = "rbxassetid://254003734"
sound.PlayOnRemove = true
sound:Play()
sound:Destroy()
if receiptInfo.ProductId == skip1 then
player.leaderstats.Stage.Value = player.leaderstats.Stage.Value + 1
player:LoadCharacter()
else
if receiptInfo.ProductId == skip2 then
player.leaderstats.Stage.Value = player.leaderstats.Stage.Value + 2
player:LoadCharacter()
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
MarketplaceService.ProcessReceipt = processReceipt
MarketplaceService.ProcessReceipt = processReceipt
StarterGui Button Script:
local productId = 972768947
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)