Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is my gamepass script not prompting the purchase?

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

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!

1 comment

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

This discussion is preserved as it was. New answers, comments, and votes are closed.