Class
GamePassService
NotCreatableService
A service associated with the legacy game pass system. Use
MarketplaceService for all new work.
The GamePassService is a service that supports legacy game passes using Asset
IDs. MarketplaceService should be used for all new game passes.
For more information about game passes, please see Game Passes.
Methods 1#
| PlayerHasPass | Returns true if the Player has the specified legacy game
pass. Does not work with new game passes.Yields |
PlayerHasPass(player: Player, gamePassId: int64): boolean#
YieldsDeprecated
This function will not work with new game passes; use
MarketplaceService:UserOwnsGamePassAsync() instead.
This function returns true if the Player has the specified
legacy game pass. The result of this function may be cached, meaning it
should not be relied on to give an up to date result.
See Passes for further information.
Legacy Game Passes#
Historically, game passes on Roblox had an asset ID associated with them. Although such game passes still have an asset ID, they now also have a pass ID. All new game passes created only have a pass ID.
Whether you are using an Asset ID or a pass ID determines which API members you can use.
| Asset ID (Legacy) | Pass ID (Current) | |
| Verify Ownership | Class.GamePassService:PlayerHasPass() |
Class.MarketplaceService:UserOwnsGamePassAsync() |
| Prompt a purchase | Class.MarketplaceService:PromptPurchase() |
Class.MarketplaceService:PromptGamePassPurchase() |
| Prompted purchase finished | Class.MarketplaceService.PromptPurchaseFinished |
Class.MarketplaceService.PromptGamePassPurchaseFinished |
| Name | Type | Default | Description |
|---|---|---|---|
player | Player | The Player for which to check ownership. | |
gamePassId | int64 | The Asset ID of the game pass. This is not the Game Pass ID (see above). |
Returns
boolean— Whether thePlayerowns the game pass.
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild