Updated scoreboard
@@ -1,3 +1,136 @@
|
|||||||
# ModuleClientApi - GameLib Scoreboard
|
# ModuleClientApi - GameLib Scoreboard
|
||||||
|
|
||||||
Class representing a Scoreboard of a GameLib Game inside the ModuleServerAPI.
|
Class representing a Scoreboard of a GameLib Game inside the ModuleServerAPI.
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
### clear
|
||||||
|
|
||||||
|
Clear all scores.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Scoreboard.clear();
|
||||||
|
```
|
||||||
|
|
||||||
|
### setScore
|
||||||
|
|
||||||
|
Set the score of a player.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Scoreboard.setScore(player, score);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------------------------------------------------ | -------------------------------- |
|
||||||
|
| player | [GamePlayer](./ModuleServerAPIGameLibGamePlayer) | The player to set the score for. |
|
||||||
|
| score | number | The score to set. |
|
||||||
|
|
||||||
|
### getScore
|
||||||
|
|
||||||
|
Get the score of a player.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Scoreboard.getScore(player);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------------------------------------------------ | -------------------------------- |
|
||||||
|
| player | [GamePlayer](./ModuleServerAPIGameLibGamePlayer) | The player to get the score for. |
|
||||||
|
|
||||||
|
**Return** number _The player score._
|
||||||
|
|
||||||
|
### hasScore
|
||||||
|
|
||||||
|
Check if a player has a score.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Scoreboard.hetScore(player);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------------------------------------------------ | ---------------------------------- |
|
||||||
|
| player | [GamePlayer](./ModuleServerAPIGameLibGamePlayer) | The player to check the score for. |
|
||||||
|
|
||||||
|
**Return** boolean _Player has a score._
|
||||||
|
|
||||||
|
### increaseScore
|
||||||
|
|
||||||
|
Increase the score of a player.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Scoreboard.increaseScore(player, amount);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------------------------------------------------ | -------------------------------------- |
|
||||||
|
| player | [GamePlayer](./ModuleServerAPIGameLibGamePlayer) | The player to increase the score for. |
|
||||||
|
| amount | number | The amount to increase the score with. |
|
||||||
|
|
||||||
|
### decreaseScore
|
||||||
|
|
||||||
|
Decrease the score of a player.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Scoreboard.decreaseScore(player, amount);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------------------------------------------------ | -------------------------------------- |
|
||||||
|
| player | [GamePlayer](./ModuleServerAPIGameLibGamePlayer) | The player to decrease the score for. |
|
||||||
|
| amount | number | The amount to decrease the score with. |
|
||||||
|
|
||||||
|
### updateUnderCondition
|
||||||
|
|
||||||
|
Update the score of a player under a condition.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Scoreboard.updateUnderCondition(condition, player, value);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| --------- | ------------------------------------------------ | ----------------------------------- |
|
||||||
|
| condition | "VALUE_IS_LOWER" / "VALUE_IS_HIGHER" | The condition to check. |
|
||||||
|
| player | [GamePlayer](./ModuleServerAPIGameLibGamePlayer) | The player to update the score for. |
|
||||||
|
| value | number | The new value of the score. |
|
||||||
|
|
||||||
|
## Constants
|
||||||
|
|
||||||
|
### **READONLY** id
|
||||||
|
|
||||||
|
The id of the scoreboard.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Scoreboard.id;
|
||||||
|
```
|
||||||
|
|
||||||
|
### **READONLY** name
|
||||||
|
|
||||||
|
The name of the scoreboard.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Scoreboard.name;
|
||||||
|
```
|
||||||
|
|
||||||
|
### **READONLY** formatting
|
||||||
|
|
||||||
|
The formatting of the scoreboard.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Scoreboard.formatting;
|
||||||
|
```
|
||||||
|
|
||||||
|
### **READONLY** sorting
|
||||||
|
|
||||||
|
The sorting of the scoreboard.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Scoreboard.sorting;
|
||||||
|
```
|
||||||
|
|
||||||
|
### **READONLY** showCount
|
||||||
|
|
||||||
|
The amount of entries to show on the scoreboard.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Scoreboard.showCount;
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user