πŸ“ˆXP & Level System Guide

The XP & Level System in dynyx_crafting allows you to create a sense of crafting progression. As players craft items, they gain XP and unlock the ability to craft higher-tier recipes.

This guide explains how the system works, how to configure it, and how to enable/disable XP requirements on a per-item basis.


πŸ”§ Configuration

In your config.lua, this section defines the XP leveling system:

Config.LevelSystem = {
    StarterLevel = 0, -- The starting level for every player
    IncreaseByAfterEachLevelUp = 500 -- XP needed increases by this amount each level
}
  • StarterLevel: This is the level players start at. Keep this at 0 for all players to begin with no crafting unlocks.

  • IncreaseByAfterEachLevelUp: Every time a player levels up, the XP needed to reach the next level increases by this amount.

    • Example:

      • Level 1 requires 500 XP

      • Level 2 requires 1000 XP

      • Level 3 requires 1500 XP

      • And so on...


πŸ§ͺ Enabling XP Per Item

Each craftable item can have XP settings individually controlled in either Config.PreSetTables or Config.PlaceableTables.

Example:

["WEAPON_PISTOL"] = {
    Label = "Pistol",
    XPEnable = true,          -- Enables XP for this item
    Level = 2,                -- Player must be at least level 2 to craft
    xpGain = 10,              -- XP earned when successfully crafted
    ...
}

πŸ”Ή Field Breakdown:

  • XPEnable: Set to true to make this item give XP and require a level.

  • Level: Minimum level required to craft this item.

  • xpGain: How much XP the player earns after crafting it.


πŸ› οΈ How XP is Awarded

Players earn XP after a short delay when crafting completes.

This is controlled by:

Config.SecondsBeforeXpGain = 5

⏱️ This means XP is awarded 5 seconds after crafting finishes. You can adjust this to fit your server’s immersion or balance needs.


🧠 Notes & Tips

  • Set XPEnable = false on basic items if you want players to always have access to them.

  • You can create crafting tiers using level milestones:

    • Level 0–1: Basic tools

    • Level 2–4: Intermediate items

    • Level 5+: Rare/illegal items

  • Use ShowOnList = false with blueprints and level restrictions to hide advanced recipes from players who aren't ready yet.


πŸ”’ Disabling the XP System

To completely disable XP-based progression for a table, simply:

  • Set XPEnable = false for all items in the table.

  • Or set Level = 0 on all recipes.

XP will still be earned (if xpGain is set), but no level restrictions will block crafting.

Last updated