How can I tell if a Player owns a gamepass?

Hello, I was wondering how I could tell if a user owns a gamepass and thats all I don’t want to prompt a purchase or anything.

1 Like
Just one search can't possibly take up too much time.

MarketplaceService | Documentation - Roblox Creator Hub

How do you check if a player owns a gamepass?

Check if Player has Gamepass

How do you check if a user owns a gamepass and if not, prompt a purchase? - Scripting Helpers

1 Like

There is a simple answer, using :UserOwnsGamepassAsync(Player.UserId, GamepassId).

8 Likes

A quick search in the developer forum, developer hub, or other roblox-development-related sites would’ve given you a quick answer; I implore you and anyone else who may be reading this to use the search filter for any question before making a post on any of those web sites


Refer to the UserOwnsGamepassAsync function of the MarketplaceService service. You can call the function in an if statement before running the prompt purchase function. If they don’t, proceed with calling with the function. The function does cache the result of the player in the server, so if they bought the game pass in-game, it would still return false if they didn’t own it at first when they joined the game when they try to prompt the purchase again

2 Likes