Example skill

Adding XP to Skills

Client Side

-- Add XP to specific category
exports['devhub_skillTree']:addXp('personal', 100)

-- Add XP on action
RegisterNetEvent('minigame:lockpickSuccess', function()
    exports['devhub_skillTree']:addXp('thief', 50)
end)

Server Side

-- Add XP to player's skill
exports['devhub_skillTree']:addXp('personal', 100, source)

-- Example: Add XP when player sells items
RegisterNetEvent('inventory:sellItems', function(items)
    local src = source
    local xpGain = #items * 10
    exports['devhub_skillTree']:addXp('thief', xpGain, src)
end)

Checking Skill Status

Client Side


Server Side


Event Listeners

Basic Health Boost System


Progressive Running Speed System


Skill Checks

Basic Bank Access


XP and Points

XP Reward System


Points Distribution System


Complete Systems

Using Listener

Progressive Weapon Handling System


Using Exports

Swimming Skill Progression System


Ensure correct skill trigger order

In certain situations, it's essential to ensure that skills are triggered in the correct order. For example, when adding more HP to a player, you might use one of the following design patterns.

Using Config.SkillLoadingOrder

This configuration allows you to define a custom order for loading events when a player first joins the server. Since player data is stored as a hashmap in the database, the loading order of events cannot be naturally controlled.

By default, all events are loaded in an arbitrary order. However, in certain cases, you may need to ensure that specific events are executed before others to properly overwrite values or establish dependencies.


Skill-Based Incremental Effect Pattern

Overview

This pattern is designed to streamline the process of applying skill effects dynamically without requiring explicit values for each skill level. Instead of defining fixed values per skill tier (e.g., more_hp_1 β†’ +120 HP, more_hp_2 β†’ +140 HP), we apply a consistent incremental effect across all levels of the same skill category.

Benefits

  • Scalability: New skill levels can be added without modifying the logic.

  • Simplicity: Eliminates the need for redundant configuration per skill level.

  • Consistency: Ensures all skill instances contribute equally.

This pattern is particularly useful for stat-based skill progression, where effects scale in a linear or predictable manner.

Example Usage

Last updated