Koja Scripts
NEW

Interaction Settings

This page covers how players interact with crafting stations - either through key press or target system (ox\_target,qb-target,).

Interaction Settings

🔧 Configuration Options

All interaction settings are located in shared/config.lua under the INTERACTION SETTINGS section.

shared/config.lua
-- ════════════════════════════════════════════════════════════════════════════════════
--  INTERACTION SETTINGS
-- ════════════════════════════════════════════════════════════════════════════════════

Config.Target = {
    enabled = false,
    resource = 'ox_target',
    icon = 'fas fa-sign-in-alt'
}

Config.Interact = {
    key = 'E',
    text = 'Press ~INPUT_CONTEXT~ to open crafting'
}

📝 Setting Descriptions

Target System Configuration

Config.Target
Config.Target = {
    enabled = false,
    resource = 'ox_target',
    icon = 'fas fa-sign-in-alt'
}

Purpose: Enable interaction through target systems (third-eye, eye-target) instead of key press.

Options:

SettingTypeDescriptionDefault
enabledBooleanEnable/disable target systemfalse
resourceStringTarget resource name'ox_target'
iconStringFont Awesome icon class'fas fa-sign-in-alt'

Key Press Configuration

Config.Interact
Config.Interact = {
    key = 'E',
    text = 'Press ~INPUT_CONTEXT~ to open crafting'
}

Purpose: Configure key-based interaction when target system is disabled.

Options:

SettingTypeDescriptionDefault
keyStringKey to press for interaction'E'
textStringHelp text shown on screen'Press ~INPUT_CONTEXT~ to open crafting'


🔧 Configuration Examples

Example: Using ox_target

Configuration:

Config.Target
Config.Target = {
    enabled = true,
    resource = 'ox_target',
    icon = 'fas fa-hammer'
}

Requirements:

  1. Step 1

    Install ox_target
  2. Step 2

    Add to server.cfg: ensure ox_target
  3. Step 3

    Ensure ox_target starts before koja-crafting
  4. Step 4

    Restart koja-crafting

Result: Players can aim at tables and see "LABEL" option with ICON.


Example: Traditional Key Press

Configuration:

Config.Target + Config.Interact
Config.Target = {
    enabled = false, -- Disable target
}

Config.Interact = {
    key = 'E',
    text = 'Press ~INPUT_CONTEXT~ to open crafting'
}

Result: Simple help text appears when near station, press E to open.


🎨 Font Awesome Icons

Icon ClassVisualUse Case
'fas fa-hammer'🔨Weapon crafting
'fas fa-toolbox'🧰Tool crafting
'fas fa-wrench'🔧Vehicle crafting
'fas fa-cog'⚙️Mechanical crafting
'fas fa-flask'🧪Chemical/drug crafting
'fas fa-mortar-pestle'🏺Medical crafting
'fas fa-tshirt'👕Clothing crafting
'fas fa-utensils'🍴Food crafting
'fas fa-box'📦General crafting
'fas fa-industry'🏭Industrial crafting

Icon Syntax

Icon example
icon = 'fas fa-hammer'
--     │   └─ Icon name
--     └─ Icon style (fas = solid, far = regular, fab = brands)

Find more icons: https://fontawesome.com/icons


🎯 Help Text Formatting

Text Formatting Options

The help text supports GTA V formatting codes:

Examples
-- Basic text
text = 'Press ~INPUT_CONTEXT~ to craft'

-- With color
text = '~g~Press ~INPUT_CONTEXT~ to craft~s~' -- Green text

-- Multiple controls
text = 'Press ~INPUT_CONTEXT~ to craft or ~INPUT_CANCEL~ to exit'

-- Custom styling
text = '~b~[CRAFTING]~s~ Press ~INPUT_CONTEXT~ to open'

Color Codes

CodeColorExample
~r~Red~r~Warning~s~
~g~Green~g~Available~s~
~b~Blue~b~Info~s~
~y~Yellow~y~Caution~s~
~p~Purple~p~Special~s~
~o~Orange~o~Alert~s~
~s~White (reset)~s~Normal

Control Input Codes

CodeResultDisplay
~INPUT_CONTEXT~E key"E"
~INPUT_CANCEL~Backspace"Backspace"
~INPUT_ENTER~Enter"Enter"
~INPUT_FRONTEND_ACCEPT~Space/Enter"Space"

Example configurations are shown above.



🔗 Useful Resources

  • General Settings — This page covers the basic configuration options for Koja-Crafting that control debug mode, language, and player behavior.
  • Server Settings — This page covers server-side configuration options including database management, crafting recovery, and shared table functionality.
  • Images Settings — This page explains how to configure item images, add custom graphics, and manage image paths in Koja-Crafting.
  • Player Progression Settings — This page covers the player progression system including levels, experience points, and how to configure the leveling system in Koja-Crafting.
  • Admin Settings — This page covers admin permission configuration and available admin commands for managing Koja-Crafting.
  • Crafting Queue Settings — This page covers the crafting queue system that manages distance checking, warnings, and crafting cancellation when players move away from stations.
  • Configuration — back to the section overview