Help wit gamepass GUI

Hello,Im new scripting and i was making and gamepass GUI,I was going good no errors But i forgot how to make the promote ;-;gam
I mean like when u click the buy button a promotion of the gamepass Pops up,i forgot how to do it…
Can some one pls tell me how to?

edit: pls dont make it too hard to understand bc im mexican and i script on english soo its very hard to me to script

2 Likes

Use

So

local id = -- Put in your gamepassid here.
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
game:GetService("MarketplaceService"):PromptGamePassPurchase(plr.UserId,id)
end)

This must be in a local script.

if i use and script it said this
image
if local script
image

wat does tat mean i dont really kwo how to use the out put when i need help i watch YT tuts but i dont Found any.

Did you put an id into the

local id =

local id = 12910189
local plr = game.Players.LocalPlayer
game:GetService(“MarketplaceService”):PromptGamePassPurchase(plr.UserId,id)

i do this*

Try

game:GetService(“MarketplaceService”):PromptGamePassPurchase(plr,tonumber(id))

omg ;-;
image

game:GetService(“MarketplaceService”):PromptGamePassPurchase(prl.UserId,tonumber(12910189))

Take off plr.UserId make it plr

idk why but it dossent work
image

Local script inside of the Buy button

local MarketplaceService = game:GetService("MarketplaceService")
local Player = game:GetService("Players").LocalPlayer
local passId = 00000 -- gamepass ID

script.Parent.MouseButton1Click:Connect(function()
     MarketplaceService:PromptGamePassPurchase(Player,passId)
end)
4 Likes