Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my gamepass script not prompting the purchase?

Asked by 6 years ago

I have this gamepass script so that when you click the gui button it asks you if you want to buy it but when i try to it says 22:11:05.710 - PurchasePromptScript: getProductInfo failed because MarketplaceService:getProductInfo() failed because rawProductInfo was empty Make sure a valid ID was specified (x2)

This is my script

local productId = 1008824264
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptPurchase(player, 1008824264)
end)

1 answer

Log in to vote
0
Answered by 6 years ago

I checked out the link of the asset that you're using and it looks like you're using a gamepass. Gamepasses can only have a purchase prompt when using PromptGamePassPurchase.

local productId = 1008824264
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptGamePassPurchase(player, 1008824264)
end)

That's all you gotta do!

0
Now its saying this ih the output -- 22:57:56.901 - Stack End 22:57:56.909 - PurchasePromptScript: getProductInfo failed because MarketplaceService:getProductInfo() failed because rawProductInfo was empty Make sure a valid ID was specified 1Messi3903 -5 — 6y
Ad

Answer this question