GivePlayerExperience
givePlayerExperience
Adds an amount to a player's authoritative experience.
Syntax
bool givePlayerExperience(int playerId, number amount)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player to update. |
amount |
number |
yes | The amount of experience to add. |
Returns
Returns true when the updated value is accepted; otherwise returns false.
Examples
Award experience to a player:
givePlayerExperience(playerId, 100)
Notes
- Available only in server-side resource scripts.
- This is a convenience wrapper around
addPlayerStatforexperience.