GetPlayerStatXP
The XP a stat has gathered toward its next level, and what that level takes.
Syntax
Section titled “Syntax”GetPlayerStatXP(pid, stat)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
stat |
string | the stat’s name |
Returns
Section titled “Returns”number, number - xp, next - the XP gathered toward the next level, and the XP the next level takes in all; next is 0 at the top level, 0, 0 when the server does not know the stat yet
Example
Section titled “Example”local xp, need = GetPlayerStatXP(pid, "strength")if need > 0 then SendClientMessage(pid, COLOR_WHITE, string.format("Strength: %.0f of %.0f XP to the next level.", xp, need))endSee also
Section titled “See also”GetPlayerStat · AddPlayerStatXP · GetPlayerSkillXP · the Stats, skills, XP and perks group of the index
