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

Gamepass Buy Button, is working but not telling to buy my gamepass?

So the script is supposed to Prompt the player to buy my gamepass, but it just comes with a free model with out my gamepass. (https://www.roblox.com/game-pass/4916610/Double-Jump)

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

script.Parent.MouseButton1Click:connect(function() --
	Game:GetService("MarketplaceService"):PromptPurchase(player, productId)
end)

6 comments

0

Are you sure that the problem is because of the script. . . because it looks fine :l

0

Maybe remaking this gamepass helps, *Good luck!

0

have you tried print debugging?

0

You're using the wrong service, roblox recently changed gamepass ids. Use the GamePassService

0

So it would be this?

0

Once I changed it to GamePassService, nothing appears to pop up for buying.

1 answer

This should work... Hopefully

local productId = 4916610 -- id

script.Parent.ClickDetector.MouseClick:Connect(function(player)
	game:GetService("MarketplaceService"):PromptGamePassPurchase(player , productId)
end)

Hope it works ;-; lol

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