I am having an issue with my skip stage button for my obby, basically when the player purchases the gamepass, nothing happens. The person who was helping me with the script, tested it in his game, and it was working. However, in my game, the script does not. Neither my friend, or I have a clue as to what the issue is, because no errors pop up.
Client code:
local marketplaceservice = game:GetService("MarketplaceService")
local skipId = 1110600158
function marketplaceservice.ProcessReceipt(receiptInfo)
print("hi")
if receiptInfo.ProductId == skipId then
local plr = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
local succ,err = pcall(function()
plr.leaderstats.Stage.Value = plr.leaderstats.Stage.Value + 1
plr.CurrentStage.Value = plr.CurrentStage.Value + 1
plr:LoadCharacter()
end)
if err then
return Enum.ProductPurchaseDecision.NotProcessedYet
else
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
end
Code in the GUI:
local MarketPlaceService = game:GetService("MarketplaceService")
local Button = script.Parent.ImageButton
local player = game.Players.LocalPlayer
local skipProduct = 1110600158
local skipEvent = game.ReplicatedStorage.Events.SkipStage
Button.MouseButton1Down:Connect(function()
MarketPlaceService:PromptProductPurchase(game.Players.LocalPlayer,skipProduct)
end)
Any suggestions would be appreciated! (:

7 comments
Does the output print "hi"?
I would recommend printing something when an error is detected as well, maybe even the error itself as the issue could be silently happening in the pcall.
The ouput does not print hi.
I actually recommend using a open-sourced obby system which includes skip stage as well. https://devforum.roblox.com/t/techys-obby-system-all-your-obby-needs-in-one-includes-stage-selector/785271/
Does the Prompt appears when you click on the gui?
Is the skip a Gamepass or a Product?
It is a developer product, and the prompt to purchase it does pop up.