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

How do I make a gui open only if the player has a certain gamepass? [closed]

Asked by 5 years ago

My goal is to have a VIP type gamepass that allows players to access a certain gui in the game shop. How do I make it so when the player clicks on the textbutton or imagebutton a gui pops up only if the that player has the gamepass. So if the player does not have the gamepass the gui will not show up for them. If anyone knows how that would be great. Thanks!

0
Not a request site! User#19524 175 — 5y

Closed as Not Constructive by User#19524, Amiaa16, evaera, and User#21908

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

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

I cannot spoon feed you as the purpose of this site is to HELP users.

I can give you a push in the right direction, though.

You’ll have to look into the MarketplaceService.

Run code if a player owns a pass.

local marketplace = game:GetService'MarketplaceService'

if marketplace:UserOwnsGamePassAsync(player.UserId, gamepassId) then
    --do code. I recommend putting this in an event/loop so it can run multiple times.

end

--Remember to define your  player and game pass Id
0
0
^That method is broken due to the game pass Id update. User#19524 175 — 5y
Ad