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

Why is the script for the gamepass worling, but in the game, it says item not for sale?


local button = script.Parent local ID = Your ID local click = Instance.new("ClickDetector", button)

click.MouseClick:Connect(function(player) game:GetService("MarketplaceService"):PromptPurchase(player, ID) end)

The script is working, but why is the gamepass itself isn't working? It says the item is not for sale. It is on sale and active and available under the store of my game.

1 answer

I see your mistake. PromptPurchase() is only for clothing items or items that go in your inventory like hats! (Only your hats and shirts and pants). You must use PromptGamePassPurchase() Like the listed below. Also please use the code boxes for code. Thanks!

local button = script.Parent 
local ID = Your ID 
local click = Instance.new("ClickDetector", button)

click.MouseClick:Connect(function(player) game:GetService("MarketplaceService"):PromptGamePassPurchase(player, ID) 
end)

1 comment

0

Thank you, @Heyltzscoop! I learn something new every day.

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