Hello, im making a scp game and I have team chance gui, that I use to chance team with. But I have a problem, I want gamepass to connect to one of the team chance button, so you only can press it if you have the gamepass. If you have the gamepass then it will chance your team to the gamepass team. We have the gamepass ready and the button gui ready I just need a script to connect it
COMMUNITY QUESTION
How to connect a game pass to a button?
2 answers
If you are new to doing this sort of code there are some scripts found in the toolbox that allow you to connect your gamepass id if it is a tool like a gun.
This works for me
local productId = --your id here
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
Game:GetService("MarketplaceService"):PromptPurchase(player, productId)
end)
when you're finished it should look something like this
gui TextButton localscript
(also make it a local script :3)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
No, is a team