SetPlayerSkill
Sets a skill of the player’s character to a level, and the XP toward the next, exactly.
skill is one of the game’s thirty skills - marksmanship, weapon_sword, heavy_weapons, horse_riding, alchemy,
stealth … (Stats and skills); a stat’s name is refused - use SetPlayerStat.
Everything else is as there: level 0 .. 30, xp gathered toward the next (a missing one is 0, one at or above what
the next level takes is cut to just under it), the set exact, lowering too, no level-up notice, waiting for the spawn when
the player is not in the world yet. fencing (Warfare) is the game’s parent of the weapon skills and works its level out
from theirs, so it is refused (false, and AddPlayerSkillXP too) - set weapon_sword and the others instead; its perk
points are its own (SetPlayerPerkPoints).
Syntax
Section titled “Syntax”SetPlayerSkill(pid, skill, level [, xp])| Parameter | Type | |
|---|---|---|
pid |
number | the player |
skill |
string | the skill’s name |
level |
number | 0 .. 30 |
xp |
number | the XP gathered toward the next level (optional) |
Returns
Section titled “Returns”boolean - false for a name that is no skill (a stat’s too, and fencing), a level that is missing, not a number or outside 0..30, an XP below 0 or infinite, or a player not connected
Example
Section titled “Example”SetPlayerSkill(pid, "weapon_sword", 15)
-- the apothecary's apprentice knows the trade alreadySetPlayerSkill(pid, "alchemy", 9, 120)See also
Section titled “See also”GetPlayerSkill · SetPlayerStat · SetPlayerProgress · AddPlayerSkillXP · the Stats, skills, XP and perks group of the index
