/
GamePassService.yaml
98 lines (91 loc) · 3.24 KB
/
GamePassService.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: GamePassService
type: class
category: Monetization
memory_category: Instances
summary: |
A service associated with the legacy game pass system. Use
`Class.MarketplaceService` for all new work.
description: |
The GamePassService is a service that supports legacy game passes using _Asset
IDs_. `Class.MarketplaceService` should be used for all new game passes.
For more information about game passes, please see
[Game Passes](../../../production/monetization/game-passes.md).
code_samples:
inherits:
- Instance
tags:
- NotCreatable
- Service
deprecation_message: ''
properties: []
methods:
- name: GamePassService:PlayerHasPass
summary: |
Returns `true` if the `Class.Player` has the specified **legacy** game
pass. Does not work with new game passes.
description: |
This function will not work with new game passes; use
`Class.MarketplaceService:UserOwnsGamePassAsync()` instead.
This function returns `true` if the `Class.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](../../../production/monetization/game-passes.md) 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.
<table>
<thead>
<tr>
<td></td>
<td>Asset ID (Legacy)</td>
<td>Pass ID (Current)</td>
</tr>
</thead>
<tbody>
<tr>
<td>Verify Ownership</td>
<td><code>Class.GamePassService:PlayerHasPass()</code></td>
<td><code>Class.MarketplaceService:UserOwnsGamePassAsync()</code></td>
</tr>
<tr>
<td>Prompt a purchase</td>
<td><code>Class.MarketplaceService:PromptPurchase()</code></td>
<td><code>Class.MarketplaceService:PromptGamePassPurchase()</code></td>
</tr>
<tr>
<td>Prompted purchase finished</td>
<td><code>Class.MarketplaceService.PromptPurchaseFinished</code></td>
<td><code>Class.MarketplaceService.PromptGamePassPurchaseFinished</code></td>
</tr>
</tbody>
</table>
code_samples:
- GamePassService-PlayerHasPass1
parameters:
- name: player
type: Player
default:
summary: |
The `Class.Player` for which to check ownership.
- name: gamePassId
type: int64
default:
summary: |
The _Asset ID_ of the game pass. This is **not** the _Game Pass ID_
(see above).
returns:
- type: bool
summary: |
Whether the `Class.Player` owns the game pass.
tags:
- Yields
- Deprecated
deprecation_message: ''
security: None
thread_safety: Unsafe
events: []
callbacks: []