How to make a frame appear when player owns gamepass

Here you can use something simple like this:

local GamepassId = 100000 -- example

local frameToShow = script.Parent.Frame -- example

local player = game.Players.LocalPlayer
repeat wait() until player.Character -- waits for player to load in

local PlayerGui = player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui")
-- quote me if im wrong, but that should work

local MarketplaceService = game:GetService("MarketplaceService")
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, GamepassId) then
  frameToShow.Visible = true
end
5 Likes