Skip to content

GetPlayerStatXP

The XP a stat has gathered toward its next level, and what that level takes.

GetPlayerStatXP(pid, stat)
Parameter Type
pid number the player
stat string the stat’s name

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

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))
end

GetPlayerStat · AddPlayerStatXP · GetPlayerSkillXP · the Stats, skills, XP and perks group of the index