This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts.
UserOwnsGamePassAsync returns true if the
Player with the given
Player/UserId|UserId owns the game pass with the given game pass ID (not to be confused with asset ID).
Results of this function are remembered so that repeated calls will return quicker. This function will always return true if the player owns the game pass upon first entering a server after having purchased the game pass. If the game pass is purchased in-game (through
MarketplaceService/PromptGamePassPurchase|PromptGamePassPurchase), this function may return false due to the caching behavior. Conversely, should the player delete the game pass from their inventory, this function may return true despite the player not owning the game pass.
Previously, querying player ownership of game passes required the use of the now-deprecated
GamePassService/PlayerHasPass function. This was changed in April 2018 when game passes received their own ID system.
On Release 350 (August 2018), this function was changed so that the result is cached. Previously, it made a request every time it was called.
The game pass ID of the game pass to be checked, not to be confused with asset ID