PurchasePromptScript: getProductInfo failed because MarketplaceService:getProductInfo() failed because rawProductInfo was empty Make sure a valid ID was specified <
LocalScript:
01 | local MPS = game:GetService( "MarketplaceService" ) |
02 | local RPS = game:GetService( "ReplicatedStorage" ) |
03 |
04 | script.Parent.MouseButton 1 Click:connect( function () |
05 | MPS:PromptProductPurchase(game.Players.LocalPlayer, 643910613 ) |
06 | end ) |
07 |
08 | RPS.Events.BuyPrompt.OnClientEvent:connect( function (player, product) |
09 | if product = = "Upgrade" then |
10 | script.Parent.Text = "You Own This Item" |
11 | end |
12 | end ) |
Main Script:
01 | local MPS = game:GetService( "MarketplaceService" ) |
02 | local RPS = game:GetService( "ReplicatedStorage" ) |
03 | local product = "" |
04 |
05 | MPS.ProcessReceipt = function (purchaseInfo) |
06 | local player = game:GetService( "Players" ):GetPlayerByUserId(purchaseInfo.PlayerId) |
07 | if purchaseInfo.ProductId = = 643910613 then |
08 | product = "Upgrade" |
09 | RPS.Events.BuyPrompt:FireClient(product) |
10 | elseif purchaseInfo.ProductId = = 653173240 then |
11 | product = "Elite" |
12 | RPS.Events.BuyPrompt:FireClient(product) |
13 | elseif purchaseInfo.ProductId = = 659939994 then |
14 | product = "Palace" |
15 | RPS.Events.BuyPrompt:FireClient(product) |
16 | end |
17 | return Enum.ProductPurchaseDecision.PurchaseGranted |
18 | end |
The error means that it cannot do PromptProductPurchase because the ID is wrong or it cannot find the ID. Double check the IDs in your scripts.