Class
PointsService
NotCreatableServiceDeprecated
This service controls the points award system used to showcase a player's achievements and participation throughout Roblox.
Deprecated. This class was once used to control an ancient achievement system since removed and deprecated. It and its members should not be used in new work.
The PointsService class controls points.
Points are an award system used to showcase a player's achievements and participation throughout Roblox. How points are awarded through this service is at the discretion of the game's developer.
Methods 4#
| AwardPoints | Attempts to award the user with the specified Player.UserId the
specified number of points.DeprecatedYields |
| GetAwardablePoints | Returns the number of points the current game has available to award to players.Deprecated |
| GetGamePointBalance | Returns the total number of points a player has in the current game.DeprecatedYields |
| GetPointBalance | Returns the total number of points the given player has across all games.DeprecatedYields |
AwardPoints(userId: int64, amount: int): Tuple#
YieldsDeprecatedDeprecated
Deprecated. This function was once part of the PointService class used to control an
ancient achievement system since removed and deprecated. It should not be
used in new work.
This function attempts to award the user with the specified
Player.UserId the specified number of points.
If successful, this function will return the UserId of the user the points were awarded to, the number of points awarded, the new total number of points the user has in the game and another value which appears to always be 0.
This function will cause an error if the specified UserId is not positive or if the number of points specified is 0.
The function can be used to award a negative number of points to a user however.
| Name | Type | Default | Description |
|---|---|---|---|
userId | int64 | ||
amount | int |
Returns
Tuple
GetAwardablePoints(): int#
DeprecatedDeprecated
Deprecated. This function was once part of the PointService class used to control an
ancient achievement system since removed and deprecated. It should not be
used in new work.
This function returns the number of points the current game has available to award to players.
Returns
int
GetGamePointBalance(userId: int64): int#
YieldsDeprecatedDeprecated
Deprecated. This function was once part of the PointService class used to control an
ancient achievement system since removed and deprecated. It should not be
used in new work.
This function returns the total number of points a player has in the current game.
| Name | Type | Default | Description |
|---|---|---|---|
userId | int64 |
Returns
int
GetPointBalance(userId: int64): int#
YieldsDeprecatedDeprecated
Deprecated. This function was once part of the PointService class used to control an
ancient achievement system since removed and deprecated. It should not be
used in new work.
This function returns the total number of points the given player has across all games.
| Name | Type | Default | Description |
|---|---|---|---|
userId | int64 |
Returns
int
Events 1#
| PointsAwarded | Fires when points have been successfully awarded to a player, while also passing along the updated balance of points the player has in the current game and all games.Deprecated |
PointsAwarded(userId: int64, pointsAwarded: int, userBalanceInGame: int, userTotalBalance: int)#
Deprecated
Deprecated. This function was once part of the PointService class used to control an
ancient achievement system since removed and deprecated. It should not be
used in new work.
This event fires when points have been successfully awarded to a player, while also passing along the updated balance of points the player has in the current game and all games.
When a player is awarded points successfully the below example would print the userId and their new point balance. If, for example, the Roblox account was awarded thirty points (and had none to begin with)
User: 1 has now earned 30 (+30) points in the current game, now making their total balance
would be printed.
| Name | Type | Default | Description |
|---|---|---|---|
userId | int64 | ||
pointsAwarded | int | ||
userBalanceInGame | int | ||
userTotalBalance | int |
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