Skip to main content

πŸ“š Skills Script

Exports


  • Award XP to a player
    exports['k_skills']:AddXP(source, skillId, amount)
  • Get current XP value for a player
    exports['k_skills']:GetXP(source, skillId)
  • Get the current level for a skill
    exports['k_skills']:GetLevel(source, skillId)
  • Set an absolute XP value (admin use typically)
    exports['k_skills']:SetXP(source, skillId, value)
  • Clear/reset XP for a skill
    exports['k_skills']:ClearXP(source, skillId)

Example:

--lets say you added a new skill called: hacking

-- Give 5 XP to a player’s hacking skill
exports.k_skills:AddXP(src, 'hacking', 5)

-- Check if they reached level 3 crafting
local lvl = exports.k_skills:GetLevel(src, 'hacking')
if lvl >= 3 then
    -- let them craft the advanced recipe
end