Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

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

Asked by 5 months ago

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

Log in to vote
4
Answered by
gioni01 2055 Moderation Voter Community Moderator
5 months ago
Edited 5 months ago

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!

0
omg sorry i took forever to answer i did not know u answered WideSteal321 445 — 5mo
0
its ok gioni01 2055 — 5mo
0
ok i gave better answer tho WideSteal321 445 — 5mo
0
ur welcome gioni01 2055 — 5mo
View all comments (9 more)
1
oops I deleted it SuperClaw250 41 — 5mo
0
accept and upvote if it helped gioni01 2055 — 5mo
0
what WideSteal321 445 — 5mo
0
mine helped more WideSteal321 445 — 5mo
0
you need to explain no "you need to use ...", what promptproductpurchase works? what promptgamepasspurchase works? yHasteeD 1573 — 5mo
0
i did WideSteal321 445 — 5mo
0
Also :connect is Deprecated use :Connect yHasteeD 1573 — 5mo
0
oh ok WideSteal321 445 — 5mo
0
i explained what promptproductpurchase does, hastee, and why he shouldnt use it gioni01 2055 — 5mo
Ad
Log in to vote
5
Answered by 5 months ago
Edited 4 months ago

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)
0
:connect is deprecated. use :Connect yHasteeD 1573 — 5mo
0
Also you need to explain, what is PomptProductPurchase for? What is PromptGamePassPurchase for? what they do... yHasteeD 1573 — 5mo
0
ok fixed WideSteal321 445 — 5mo
0
PromptProductPurchase is for buy Dev. Products yHasteeD 1573 — 5mo
View all comments (3 more)
0
but i still gave a better answer than gioni01 WideSteal321 445 — 5mo
0
oh oof wait WideSteal321 445 — 5mo
0
omg why he accept his WideSteal321 445 — 5mo

Answer this question