How to have a NPC check for a gamepass?

Hello!
I’m new to Roblox Studio and Lua in general, and I was wondering how to have a NPC check for a game-pass? For example, if you have a “[Gear name here] pass”, you could ask a NPC for [Gear name here] and it would give you it, or decline if you don’t own the gamepass. I haven’t really gotten a good answer to this so any help is appreciated!

1 Like

Uh, I think your question is how to check if a player owns a gamepass.

For that you can use:
MarketPlaceService:UserOwnsGamePassAsync(gamepassId)

3 Likes