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 12 days 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)
0
i explained why, why did u accept his? WideSteal321 309 — 12d
0
and his is deprecated WideSteal321 309 — 12d
0
(at line 4) WideSteal321 309 — 12d

2 answers

Log in to vote
4
Answered by
gioni01 1494 Moderation Voter
12 days ago
Edited 12 days 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 309 — 12d
0
its ok gioni01 1494 — 12d
0
ok i gave better answer tho WideSteal321 309 — 12d
0
ur welcome gioni01 1494 — 12d
View all comments (9 more)
1
oops I deleted it SuperClaw250 30 — 12d
0
accept and upvote if it helped gioni01 1494 — 12d
0
what WideSteal321 309 — 12d
0
mine helped more WideSteal321 309 — 12d
0
you need to explain no "you need to use ...", what promptproductpurchase works? what promptgamepasspurchase works? yHasteeD 1467 — 12d
0
i did WideSteal321 309 — 12d
0
Also :connect is Deprecated use :Connect yHasteeD 1467 — 12d
0
oh ok WideSteal321 309 — 12d
0
i explained what promptproductpurchase does, hastee, and why he shouldnt use it gioni01 1494 — 12d
Ad
Log in to vote
7
Answered by 12 days ago
Edited 12 days 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 1467 — 12d
0
Also you need to explain, what is PomptProductPurchase for? What is PromptGamePassPurchase for? what they do... yHasteeD 1467 — 12d
0
ok fixed WideSteal321 309 — 12d
0
PromptProductPurchase is for buy Dev. Products yHasteeD 1467 — 12d
View all comments (4 more)
0
but i still gave a better answer than gioni01 WideSteal321 309 — 12d
0
oh oof wait WideSteal321 309 — 12d
0
omg why he accept his WideSteal321 309 — 12d
0
probs my best answer eva' WideSteal321 309 — 8d

Answer this question