Advertisement
MachoPiggies

Roblox Gamepass Holder Only UI

Apr 13th, 2019
4,765
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. local GAMEPASSID = 0000000 --// Set this to your gamepass ID
  2.  
  3. if game:GetService("MarketplaceService"):UserOwnsGamepassAsync(game.Players.LocalPlayer.UserId, GAMEPASSID) then --// User HAS the pass
  4.     for i,v in pairs(script.Parent:GetChildren()) do --// Getting all the objects in the GUI, if your GUI has more than 1 frame or no frame at all.
  5.         pcall(function() --// This is to stop it showing errors if you've got any weird objects in your ScreenGui
  6.             v.Visible = true  --// Appears
  7.         end)
  8.     end
  9. else --// User DOESN'T have the pass
  10.     for i,v in pairs(script.Parent:GetChildren()) do --// Getting all the objects in the GUI, if your GUI has more than 1 frame or no frame at all.
  11.         pcall(function() --// This is to stop it showing errors if you've got any weird objects in your ScreenGui
  12.             v.Visible = false --// Doesn't appear
  13.         end)
  14.     end
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement