GetPlayerStat: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Automatyczna aktualizacja dokumentacji funkcji
 
Complete Lua function catalog
 
Line 32: Line 32:
* 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:53, 15 August 2026

getPlayerStat

Returns one authoritative numeric progression stat for a player.

Syntax

number getPlayerStat(int playerId, string statName)

Parameters

Name Type Required Description
playerId int yes The connected player to inspect.
statName string yes A supported stat key.

Returns

Returns the numeric stat value, or false if the player or key is invalid.

Examples

Read a player's health:

local health = getPlayerStat(playerId, "health")
if health then
    print("Health:", health)
end

Notes

  • Available only in server-side resource scripts.