🛠️Exports & events

Necessary exports and events available in this resource

Client side

Opening the skill menu
TriggerEvent('pc_skills:client:openSkillMenu')
exports.pc_skills:openSkillMenu()

Skills menu will open for player that triggers the export/event. There's also a /nui command

Checking the skill level or xp
exports.pc_skills:getSkill("skillName", "type")

• skillName - string - skill name, for example - "skill1" • type - string - "xp", "lvl" or "*" - depending on what you want to check

returns: > An int value when using "xp" or "lvl" > Table containing xp and lvl when using "*"

For safety reasons, setting lvl/xp or giving xp is possible only on server side.

Server side

Opening the skill menu for given player
TriggerEvent('pc_skills:client:openSkillMenu', player)
exports.pc_skills:openSkillMenu(player)

• player - playerId - id of the player you want to open menu for

Skills menu will open for target player

Checking the skill level or xp of given player
exports.pc_skills:getSkill(player, "skillName", "type")

• player - playerId - id of the player you want to check • skillName - string - skill name, for example - "skill1" • type - string - "xp", "lvl" or "*" - depending on what you want to check

returns: > An int value when using "xp" or "lvl" > Table containing xp and lvl when using "*"

Setting xp or level for given player
exports.pc_skills:setSkill(player, "skillName", 'type', value)

• player - playerId - id of the player you want to set lvl/xp for • skillName - string - skill name, for example - "skill1" • type - string - "xp" or "lvl" - depending on what you want to set • value - int - number you want to set

example: exports.pc_skills:setSkill(1, "skill1", 'lvl', 10) - sets lvl 10 of skill1 for player with id 1

Adding xp for given player
exports.pc_skills:giveXP(player, "skillName", value)

• player - playerId - id of the player you want to give xp to • skillName - string - skill name, for example - "skill1" • value - int - xp amount you want to give

example: exports.pc_skills:giveXP(1, "skill1", 10) - gives 10 xp in skill1 to player with id 1

Last updated

Was this helpful?