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

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

Asked by 4 years ago

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

Log in to vote
0
Answered by
Lakodex 711 Moderation Voter
4 years ago

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)
0
Thank you, @Heyltzscoop! I learn something new every day. RadiiTorment 0 — 4y
Ad

Answer this question