0

How would you make a product to skip more than one stage? (Obby)

Hello, I'm making a obby type game with a shop gui where you can buy products to skip either one, five or ten stages. The problem is the script to skip one stage works but it doesn't work to skip 5 stages. My local scripts to prompt the purchase to the player work but for some reason when I try to add more than one stage to the player leaderstats value it doesn't work. I would be so thankful if y'all can help me. (code below

Here's the server side script to skip one stage product (working) :

local marketPlaceService = game:GetService("MarketplaceService")

marketPlaceService.ProcessReceipt = function(receiptInfo)
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)

if receiptInfo.ProductId == 1337983530 then
wait(1)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end


And here is the server side script for the skip five stages product (not working) :

local marketPlaceService = game:GetService("MarketplaceService")

marketPlaceService.ProcessReceipt = function(receiptInfo)
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)

if receiptInfo.ProductId == 1339759965 then
wait(1)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end


0
Btw, it doesn't even add on the leaderstats when you buy the skip 5 stages product neither does it reload the character, it just doesn't do anything unlike the "skip one stage" ssj_ase 0 — 12d
0
Still stuck with that, I thought I succeded to fix it but now the skip five stages works but not the ten one ssj_ase 0 — 11d

0
9mze 178
9 days ago
Edited 9 days ago

You can only set ProcessReceipt once. So just combine it into one script.

local marketPlaceService = game:GetService("MarketplaceService")

marketPlaceService.ProcessReceipt = function(receiptInfo)
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)

wait(1)