🤠 Wild Country Libs
Server API

Skills

VORP skill helpers: read a character's level and XP, and award XP. These functions are VORP-only — on RSG they log a warning and return safe defaults rather than crashing.

GetSkillInfo(source, skillName) → table|nilserver

Returns { level = number, xp = number } for the named skill, or nil if unavailable.

ParamTypeDescription
sourcenumberPlayer server source ID.
skillNamestringSkill identifier, e.g. 'hunting', 'fishing'.
GiveSkillXP(source, skillName, amount) → booleanserver

Awards XP to the named skill. Returns true on success.

ParamTypeDescription
sourcenumberPlayer server source ID.
skillNamestringSkill identifier.
amountnumberXP to award.
ApplySkillBonus(source, skillName, amount, notifyMsg) → booleanserver

Awards XP and optionally fires a wc_notify SUCCESS notification to the player.

ParamTypeDescription
sourcenumberPlayer server source ID.
skillNamestringSkill identifier.
amountnumberXP to award.
notifyMsgstring | nilIf provided, fires wc_notify SUCCESS with this message.
example
-- award 25 hunting XP and notify the player
exports.wc_libs:ApplySkillBonus(source, 'hunting', 25, '+25 Hunting XP')

-- read current level
local info = exports.wc_libs:GetSkillInfo(source, 'hunting')
if info then
  print('Level: ' .. info.level .. ' | XP: ' .. info.xp)
end
RSG has no equivalent skill system. GetSkillInfo and GiveSkillXP return defaults and log a warning on RSG — use WCLib.Framework.Is('vorp') to guard calls if your resource targets both frameworks.

Real Wild County example — corn delivery skill reward

wc_corndelivery/server/main.lua
if wc:Framework.Is('vorp') then
  wc:ApplySkillBonus(src, 'trading', 15, '+15 Trading XP')
end

Common mistakes

Troubleshooting