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

Can i please have help about the game pass?

Asked by 5 years ago

There is an output error when i'm trying make it but it wont work. The script is:

script.Parent.MouseButton1Click:Connect(function()
game:GetService("MarketplaceService"):PromptPurchase(4862753)
end)

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

So if you want to use the gamepassGui there is the localscript:

function Click()
local players = game.Players.LocalPlayer
local id = 4862753
game:GetService("MarketplaceService"):PromptGamePassPurchase(players, id)
end

script.Parent.MouseButton1Click:Connect(Click)
0
Thank you! ieverhart 62 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

First of all, you should be using PromptGamePassPurchase because it's a gamepass. Here!

As you can see, the first argument is UserID. To get that userId, use LocalPlayer. The second argument is the gamepass id

Here's your script fixed:

local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
    game:GetService("MarketplaceService"):PromptGamePassPurchase(player.UserId,ID)
end)
--Put the gamepass id where it says "ID"

Be sure to use the correct one!

0
I need the gamepassgui ieverhart 62 — 5y
0
oh one second Sharkeedub 179 — 5y
0
It cut off the gamepass id for whatever reason, but make sure you just put the gamepass id as the second argument Sharkeedub 179 — 5y

Answer this question