DEVHUB DOCUMENTATION
Tebex StoreDevhub LIbDiscord Support
  • 🏠Home page
  • 🐌Download purchased assets
  • â‰ī¸Error: "You lack the required entitlement to use"
  • â‰ī¸Error: syntax error near '<\1>'
  • 💾Partnered FiveM Hosting
  • 💾SCRIPTS
    • 📗devhub_lib (NEEDED FOR EACH SCRIPT!)
      • đŸ’ģInstallation
      • 2ī¸âƒŖMigration from v1 to v2
      • âš™ī¸Framework
      • đŸ–ī¸Target
      • 🧭Ui
      • 🔑Vehicle Keys
      • â›ŊVehicle fuel
      • 🔊Sound System
      • 👕Clothing
      • â„šī¸Logs
      • 📡SQL
      • 🎨UI Color Customization
      • 🆘Compatibility test
  • 🔧Car Tune
    • đŸ’ģInstallation
    • đŸ› ī¸Configuration
    • 💾Saving Cartune Settings
  • 🚙Car Dancing
    • đŸ’ģInstallation
    • đŸ› ī¸Configuration
      • Beat generating
  • đŸ’ĒSkill Tree
    • đŸ’ģInstallation
    • đŸ› ī¸Configuration
    • đŸŽĢDevelopment
      • Listeners
      • Exports
      • Example skill
      • Pre-made skills
    • âš™ī¸Skill Generator
    • 🎨UI Color Customization
    • ❔FAQ
  • â›ī¸Miner Job
    • đŸ’ģInstallation
    • đŸ› ī¸Configuration
      • client.lua
      • shared.lua
      • server.lua
      • skillTree.lua
      • config.js
    • 🎨UI Color Customization
  • đŸĒĩDrywood Cutter Job
    • đŸ’ģInstallation
    • đŸ› ī¸Configuration
      • client.lua
      • shared.lua
      • server.lua
      • skillTree.lua
      • config.js
      • zones.lua
    • 🎨UI Color Customization
  • 🌊Pool Cleaner Job
    • đŸ’ģInstallation
    • đŸ› ī¸Configuration
      • client.lua
      • shared.lua
      • server.lua
      • skillTree.lua
      • config.js
      • zones.lua
    • 🎨UI Color Customization
  • đŸŒŋ[FREE] Herbal Alchemist Job
    • đŸ’ģInstallation
    • đŸ› ī¸Configuration
      • client.lua
      • shared.lua
      • server.lua
      • skillTree.lua
      • config.js
    • 🎨UI Color Customization
  • 📱Who Am I?
    • đŸ’ģInstallation
    • đŸ› ī¸Configuration
      • shared.lua
      • server.lua
    • 🎨UI Color Customization
  • 🎆Skill Selection
    • đŸ’ģInstallation
    • đŸ› ī¸Configuration
    • đŸ’ĒSkill Tree connection
    • 🎨UI Color Customization
  • 🍲3D CRAFTING TABLE
    • đŸ’ģInstallation
    • đŸ› ī¸Configuration
    • ❓How to create table
    • 🌹Custom props
  • đŸ‹ī¸Gym
    • đŸ’ģInstallation
    • đŸ› ī¸Configuration
  • â™Ÿī¸Props
    • đŸ–ŧī¸Paintings Pack
    • đŸ”ĒKitchen Furniture Pack
Powered by GitBook
On this page
  • Client Events
  • Skill Unlock Event
  • XP Gain Event
  • Skill Reset Event
  • Level Up Event
  1. Skill Tree
  2. Development

Listeners

Client Events

Skill Unlock Event

Triggered when a player unlocks a new skill and after player is loaded first time to server. This should be used if you have skill which apply effect one time, its good for optimalization.

local moreHp = 0
RegisterNetEvent('devhub_skillTree:client:listener:skillUnlocked', function(categoryUid, skillUid, firstUnlock)
    local ped = PlayerPedId()
    local maxHp = GetEntityMaxHealth(ped)
    if categoryUid == 'personal' and skillUid == 'moreHp' then
        moreHp = moreHp + 50
    end
    SetPedMaxHealth(ped, maxHp + moreHp)
    if firstUnlock then
        print("USER UNLOCKED NEW SKILL")
    end
end)

Parameters:

  • categoryUid (string): Category name (e.g., 'personal')

  • skillUid (string): Unique identifier of the unlocked skill

  • firstUnlock (boolean) It will only be true on skill unlock and when synced on relog it will be nil


XP Gain Event

Triggered when a player receives new XP.

XP from the personal category is cached on the client side and refreshed every few minutes

RegisterNetEvent('devhub_skillTree:client:listener:newXp', function(categoryUid, amount)
    exports['your-hud']:ShowNotification({
        type = 'xp',
        message = string.format('+%d XP (%s)', amount, categoryUid),
        duration = 3000
    })
end)

Parameters:

  • categoryUid (string): Category name (e.g., 'personal')

  • amount (number): Amount of XP received


Skill Reset Event

Triggered when a player resets their skills in a category.

local effectApplied = true
RegisterNetEvent('devhub_skillTree:client:listener:skillReset', function(categoryUid)
    if categoryUid == 'personal' then
        effectApplied = false
    end
end)

Parameters:

  • categoryUid (string): Category name (e.g., 'personal')


Level Up Event

Triggered when a player levels up in a skill category.

RegisterNetEvent('devhub_skillTree:client:listener:levelUp', function(categoryUid, newLevel)
    exports['your-hud']:ShowNotification({
        type = 'level',
        message = string.format('Level up! %s reached level %d', categoryUid, newLevel),
        duration = 3000
    })
end)

Parameters:

  • categoryUid (string): Category name (e.g., 'personal')

  • newLevel (number): The new level achieved

PreviousDevelopmentNextExports

Last updated 12 days ago

đŸ’Ē
đŸŽĢ