AddPlayerStat

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 12:43, 4 August 2026 by QCherry (talk | contribs) (Automatyczna aktualizacja dokumentacji funkcji)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.