userPlayer Progression Settings

This page covers the player progression system including levels, experience points, and how to configure the leveling system in Koja-Crafting.

🔧 Configuration Options

All progression settings are located in shared/config.lua under the PLAYER PROGRESSION section.

-- ════════════════════════════════════════════════════════════════════════════════════
--  PLAYER PROGRESSION
-- ════════════════════════════════════════════════════════════════════════════════════

Config.StartingValues = {
    level = 1,
    exp = 0
}

Config.Levels = {
    { level = 1, expToNext = 100 },
    { level = 2, expToNext = 200 },
    { level = 3, expToNext = 300 },
    { level = 4, expToNext = 400 },
    { level = 5, expToNext = 500 }
}

📝 How Progression Works

System Overview

1

New players

New players start with configured level and exp.

2

Crafting items

Crafting items grants experience points (defined per item).

3

Reaching XP threshold

Reaching the XP threshold automatically levels up the player.

4

Higher levels

Higher levels unlock new crafting recipes (items have requiredLevel).

5

Progress is saved

Progress is saved to the database automatically.

⭐ Starting Values

Purpose: Define initial crafting level and experience for new players.

Configuration Options

Setting
Type
Description
Default

level

Number

Starting crafting level

1

exp

Number

Starting experience points

0

Examples

Standard Start (Everyone begins at level 1):

Boosted Start (Players start at level 2):

VIP Start (Players start at level 3 with some XP):

📈 Level Configuration

Purpose: Define XP requirements for each level and control progression curve.

Structure Explanation

Each level entry contains:

  • level: The current level number

  • expToNext: Experience points needed to reach the NEXT level

Example Calculation

Total XP needed for each level:

  • Level 1 → 2: 100 XP

  • Level 2 → 3: 200 XP (total: 300 XP)

  • Level 3 → 4: 300 XP (total: 600 XP)

  • Level 4 → 5: 400 XP (total: 1000 XP)

  • Level 5 → 6: 500 XP (total: 1500 XP)

🎮 Item Experience Configuration

Experience is granted per item in the crafting configuration:

XP Balancing Guidelines

Item Complexity
Crafting Time
Suggested XP
Level Requirement

Basic

5-10s

5-15 XP

Level 1

Common

10-30s

15-30 XP

Level 1-2

Uncommon

30-60s

30-50 XP

Level 2-3

Rare

60-120s

50-80 XP

Level 3-4

Epic

120-300s

80-150 XP

Level 4-5

Legendary

300s+

150-300 XP

Level 5+

Example Configuration

🔓 Level-Gated Content

Basic Progression Lock

Items can be locked behind level requirements:

Tiered Crafting System

Create progression tiers for organized gameplay:

🛠️ Admin Commands

Add Experience Points

Grant XP to players using the admin command:

Examples:

Requirements:

  • Must have admin permissions (see Admin Permissions)

  • Player must be online

  • Amount must be a positive number

What happens:

  • XP is added to player's current total

  • Player may level up if XP threshold is reached

  • Progress is saved to database immediately

  • Player receives notification

🔍 Troubleshooting

chevron-rightXP not being grantedhashtag
  • Check if item has exp field defined

  • Verify player crafting completes successfully

  • Check database connection

  • Enable Config.Debug = true to see XP events

chevron-rightPlayer not leveling uphashtag
  • Verify Config.Levels is configured correctly

  • Check current XP vs expToNext requirement

  • Look for database errors in console

  • Manually check database: SELECT * FROM koja-crafting WHERE identifier = '...'

chevron-rightStarting values not applyinghashtag
  • Ensure player is new (hasn't crafted before)

  • Check if database entry exists (delete to reset)

  • Verify Config.StartingValues in config.lua

  • Restart resource after config changes

chevron-rightAdmin command not workinghashtag
  • See Admin Permissions for setup

  • Verify player has admin group

  • Check console for permission errors

  • Use correct syntax: /addexp [id] [amount]

  • For admin command configuration, see Admin Permissions

  • For item configuration, see Crafting Stations

  • For database setup, see Server Settings

  • For commands list, see Commands

Last updated