GetPlayerStat

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

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.