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

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

Asked by 5 years 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 5 years ago
Edited 5 years 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 773 — 5y
0
its ok Gey4Jesus69 2705 — 5y
0
ok i gave better answer tho WideSteal321 773 — 5y
0
ur welcome Gey4Jesus69 2705 — 5y
View all comments (9 more)
1
oops I deleted it User#23357 0 — 5y
0
accept and upvote if it helped Gey4Jesus69 2705 — 5y
0
what WideSteal321 773 — 5y
0
mine helped more WideSteal321 773 — 5y
0
you need to explain no "you need to use ...", what promptproductpurchase works? what promptgamepasspurchase works? yHasteeD 1819 — 5y
0
i did WideSteal321 773 — 5y
0
Also :connect is Deprecated use :Connect yHasteeD 1819 — 5y
0
oh ok WideSteal321 773 — 5y
0
i explained what promptproductpurchase does, hastee, and why he shouldnt use it Gey4Jesus69 2705 — 5y
Ad
Log in to vote
4
Answered by 5 years ago
Edited 5 years 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 1819 — 5y
0
Also you need to explain, what is PomptProductPurchase for? What is PromptGamePassPurchase for? what they do... yHasteeD 1819 — 5y
0
ok fixed WideSteal321 773 — 5y
0
PromptProductPurchase is for buy Dev. Products yHasteeD 1819 — 5y
View all comments (2 more)
0
but i still gave a better answer than gioni01 WideSteal321 773 — 5y
0
oh oof wait WideSteal321 773 — 5y

Answer this question