AddPlayerStatXP
Gives a stat XP the game’s own way.
As if the character had earned it: the bar fills, and a level it reaches shows the game’s level-up notice and brings the
perk points that level carries. xp is above 0 and at most 100000. It only ever raises (lower a level with
SetPlayerStat), and it is the mode’s own giving, so it does not pass the XP rate (SetXPRate) or
OnPlayerGainXP. The record follows with the player’s next report: GetPlayerStat right after still shows the old
level, and a level earned this way arrives as OnPlayerLevelUp like any other. Called before the player is in the world,
it is given right after their spawn. The main level (mainlevel) has no XP of its own - it rises with the other levels - and
is refused.
Syntax
Section titled “Syntax”AddPlayerStatXP(pid, stat, xp)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
stat |
string | the stat’s name |
xp |
number | above 0, at most 100000 |
Returns
Section titled “Returns”boolean - false for a name that is no stat (a skill’s too, and mainlevel), an amount outside that, or a player not connected
Example
Section titled “Example”-- a day of hauling sacks for the millerAddPlayerStatXP(pid, "strength", 60)See also
Section titled “See also”AddPlayerSkillXP · SetPlayerStat · GetPlayerStatXP · OnPlayerLevelUp · the Stats, skills, XP and perks group of the index
