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!
COMMUNITY QUESTION
How do I make a gui open only if the player has a certain gamepass?
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
This is also an alternative you could use: https://wiki.roblox.com/index.php?title=API:Class/GamePassService/PlayerHasPass
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.

1 comment
Not a request site!