AddPlayerStat: Difference between revisions
Jump to navigation
Jump to search
Automatyczna aktualizacja dokumentacji funkcji |
Complete Lua function catalog |
||
| Line 31: | Line 31: | ||
* Available only in server-side resource scripts. | * Available only in server-side resource scripts. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:Progression Functions]] | [[Category:Progression Functions]] | ||
[[Category:Player Functions]] | [[Category:Player Functions]] | ||
Latest revision as of 09:52, 15 August 2026
addPlayerStat
Adds a signed amount to an authoritative numeric progression stat.
Syntax
bool addPlayerStat(int playerId, string statName, number amount)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player to update. |
statName |
string |
yes | A supported stat key. |
amount |
number |
yes | Amount to add; use a negative number to subtract. |
Returns
Returns true when the updated value is accepted; otherwise returns false.
Examples
Heal a player by ten points:
addPlayerStat(playerId, "health", 10)
Notes
- Available only in server-side resource scripts.