Skip to content

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

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)

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

SetPlayerSkill(pid, "weapon_sword", 15)
-- the apothecary's apprentice knows the trade already
SetPlayerSkill(pid, "alchemy", 9, 120)

GetPlayerSkill · SetPlayerStat · SetPlayerProgress · AddPlayerSkillXP · the Stats, skills, XP and perks group of the index