PoisonCode Docs
TebexDiscordYoutube
  • SCRIPTS
    • šŸ’”pc_collections
      • ✨Features
      • šŸ–„ļøInstallation & dependencies
      • šŸ› ļøExports & events
      • āš™ļøOpen files preview
      • šŸ”§Tutorials
      • šŸ“„Updates
        • šŸ¤”How to update
        • šŸ”ŒVersion compatibility
    • šŸ’Žpc_organizations
      • ✨Features
      • šŸ–„ļøInstallation & dependencies
      • šŸ› ļøExports & events
      • āš™ļøOpen files preview
      • šŸ”§Tutorials
      • šŸ“„Updates
        • šŸ¤”How to update
        • šŸ”ŒVersion compatibility
    • šŸ’”pc_skills
      • ✨Features
      • šŸ–„ļøInstallation & dependencies
      • šŸ› ļøExports & events
      • āš™ļøOpen files preview
      • šŸ”§Tutorials
      • šŸ“„Updates
        • šŸ¤”How to update
    • šŸ“¦pc_airdrop
      • ✨Features
      • šŸ–„ļøInstallation & dependencies
      • āš™ļøOpen files preview
      • šŸ”§Tutorials
      • šŸ“„Updates
        • šŸ¤”How to update
    • šŸ’¬pc_notifications
      • ✨Features
      • šŸ–„ļøInstallation & dependencies
      • šŸ•¹ļøUsage
Powered by GitBook
On this page
  • Client side
  • Server side

Was this helpful?

  1. SCRIPTS
  2. pc_skills

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

PreviousInstallation & dependenciesNextOpen files preview

Last updated 4 months ago

Was this helpful?

šŸ’”
šŸ› ļø