I have a problem with Developer Products lately,
When i hit the TextButton
which revives/teleports you back to game, it doesnt show up the store,
so the player cannot buy the Developer Product
im a beginner to MarketplaceService, i only understand how Game Passes work for now...
local spawns = game.Workspace.DisappearingPlates.Spawner local plr = script.Parent.Parent.Parent.Parent.Parent local link = game:GetService("MarketplaceService") script.Parent.MouseButton1Click:connect(function() local marketId = 23552031 link:PromptProductPurchase(plr,marketId) link.ProcessReceipt = function(receiptInfo) if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == plr.userId then plr.Character:MoveTo(spawns.Position) plr.InGame = true wait(1) end end end)
Your problem is that you're defining the ProcessReceipt
after you already prompt the purchase Doing this will make it so if the player buys the Developer Product, nothing will happen and they will lose their money.
Also, your conditional on line 10
is using an Enum as a condition.. that doesn't make any sense. What you need to do is check if the receiptInfo.ProductId
matches your predefined marketId - which by the way I suggest you move outside of the scope of the MouseButton1Click
event.
Lastly, you NEED to return Enum.ProductPurchaseDecision.PurchaseGranted
.. otherwise you will not gain any money from the purchase.
local spawns = game.Workspace.DisappearingPlates.Spawner local plr = script.Parent.Parent.Parent.Parent.Parent local link = game:GetService("MarketplaceService") local marketId = 23552031 link.ProcessReceipt = function(receiptInfo) if receiptInfo.ProductId == marketId then plr.Character:MoveTo(spawns.Position) plr.InGame = true wait(1) return Enum.ProductPurchaseDecision.PurchaseGranted end end script.Parent.MouseButton1Click:connect(function() link:PromptProductPurchase(plr,marketId) end)