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

How do you redirect shop gui to gamepasses and not the library?

When you click the button, it's supposed to give you the gamepass with the Id of 4894476 but instead gives you the model with the id of 4894476. How do you make it so you buy the gamepass instead? if you get what I mean.

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

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

2 answers

✓ Accepted answer

You need to use :PromptGamePassPurchase() instead. :PromptProductPurchase() applies to items in the library and developer products.

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

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

Resources:

:PromptGamePassPurchase()

Accept and upvote if this helped!

13 comments

0

omg sorry i took forever to answer i did not know u answered

0

its ok

0

ok i gave better answer tho

0

ur welcome

1

oops I deleted it

0

accept and upvote if it helped

0

what

0

mine helped more

0

you need to explain no "you need to use ...", what promptproductpurchase works? what promptgamepasspurchase works?

0

i did

0

Also :connect is Deprecated use :Connect

0

oh ok

0

i explained what promptproductpurchase does, hastee, and why he shouldnt use it

Since I believe April 2018 they have changed it gamepasses are no longer in library yet there separate thing and no longer a product yet it is a GamePass (why it is now PromptGamePassPurchase not PromptProductPurchase) PromptProductPurchase is purchasing a devproduct.

Here I have changed it:


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

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

6 comments

0

:connect is deprecated. use :Connect

0

Also you need to explain, what is PomptProductPurchase for? What is PromptGamePassPurchase for? what they do...

0

ok fixed

0

PromptProductPurchase is for buy Dev. Products

0

but i still gave a better answer than gioni01

0

oh oof wait

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