check if player owns gamepass

-- Step 1: Define the player and gamepass ID
local player = game.Players.LocalPlayer
local gamepassId = "YourGamepassIDHere"

-- Step 2: Check if the player owns the gamepass
local hasGamepass = player:HasPass(gamepassId)

-- Step 3: Perform actions based on gamepass ownership
if hasGamepass then
    -- Player owns the gamepass, perform desired actions
    print("Player owns the gamepass!")
    -- Add additional actions here
    -- Player does not own the gamepass, perform alternative actions
    print("Player does not own the gamepass.")
    -- Add alternative actions here

Make sure to replace "YourGamepassIDHere" with the actual ID of your gamepass.