Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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!

1 comment

0

Not a request site!

1 answer

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

2 comments

0

^That method is broken due to the game pass Id update.

This discussion is preserved as it was. New answers, comments, and votes are closed.