Configuration

βš™οΈ Configuration Guide

This comprehensive guide covers all configuration options for the TW Scrapyard system. The configuration is split across two main files: config.lua (gameplay settings) and coordinate.lua (location data and machine setups).


πŸ“‹ Table of Contents

  1. Core Settings

  2. Framework Integration

  3. UI & Interaction

  4. Job Configuration

  5. Mission Regions

  6. Scrap Spawn System

  7. Processing Machines

  8. Vehicle System

  9. Reconnection System

  10. XP & Progression


Core Settings

Framework Selection

Supported Frameworks:

  • 'esx' - ESX Framework (latest)

  • 'oldesx' - ESX Legacy (older versions)

  • 'qb' - QBCore / QBox (latest)

  • 'oldqb' - QBCore (older versions)

  • 'vrp' - vRP Framework

If you're using QBox, set this to 'qb' - they share the same configuration.


Database Configuration

Supported Adapters:

  • "oxmysql" - OxMySQL (recommended)

  • "mysql-async" - MySQL Async

  • "ghmattimysql" - GHMatti MySQL


Inventory Integration

Supported Inventory Systems:

  • "qb_inventory" - QBCore Inventory

  • "esx_inventory" - ESX Inventory

  • "ox_inventory" - Ox Inventory

  • "qs_inventory" - Quasar Inventory

Image Path Examples:

  • QBCore: "nui://qb-inventory/html/images/"

  • Ox Inventory: "nui://ox_inventory/web/images/"

  • ESX: "nui://esx_inventoryhud/html/img/items/"


Currency Settings

Account Types:

  • "bank" - Bank account

  • "cash" - Cash on hand

  • "money" - Default money (framework-dependent)

Currency Symbols:

  • '$' - US Dollar

  • '€' - Euro

  • 'β‚Ί' - Turkish Lira

  • 'Β£' - British Pound


Framework Integration

Interaction System

Supported Systems:

  • 'drawtext' - Native 3D text (recommended)

  • 'qb-target' - QBCore Target

  • 'ox-target' - Ox Target

DrawText offers the best performance and works with all frameworks out of the box.


Vehicle Key Systems

Automatically Supported Key Systems:

  • cd_garage

  • qs-vehiclekeys

  • wasabi_carlock

  • qb-vehiclekeys

  • qbx-vehiclekeys

  • Renewed-Vehiclekeys

Custom Integration:


Fuel System Integration

Supported Fuel Systems:

  • LegacyFuel

  • x-fuel

  • ox_fuel

  • cdn-fuel

  • ps-fuel

  • Native (fallback)


Clothing System

Supported Clothing Systems:

  • "qb-clothing" - QBCore Clothing

  • "fivem-appearance" - FiveM Appearance

  • "illenium-appearance" - Illenium Appearance

  • "esx_skin" - ESX Skin

  • "rcore_clothing" - RCore Clothing

Job Outfits:


UI & Interaction

Default UI Positions

Players can customize these positions in-game through the settings menu. These are just the defaults.


Language Configuration

Adding Custom Languages:

  1. Create new locale file: locales/yourlang.lua

  2. Copy structure from locales/en.lua

  3. Translate all strings

  4. Add to Config.LanguageTitle array


Notification System

Message Types:

  • "success" - Green notification

  • "error" - Red notification

  • "info" - Blue notification

  • "warning" - Orange notification


Job Configuration

Job Location

Job Restriction:

  • 'all' - Everyone can access

  • 'police' - Only police

  • 'mechanic' - Only mechanics

  • Custom job names from your framework


Job Cooldown

Examples:

  • 0 - No cooldown (unlimited jobs)

  • 1 - 1 hour cooldown

  • 6 - 6 hours cooldown

  • 24 - Daily cooldown


Mission Completion Rewards


Daily Missions

Daily Mission System:

  • Resets every 24 hours

  • Tracks progress across all players

  • Bonus rewards for completion

  • Progress saved in database


Mission Regions

Region Configuration


Job Tasks

Task Types:

  • rent_vehicle - Rent a vehicle from showroom

  • scrap_createobject - Collect scrap objects from world

  • scrap_press - Press items in press machine

  • shredding_press - Shred pressed items

  • melt_scrap - Melt metal in furnace

  • fill_moulds - Pour metal into moulds


Illegal Area Configuration


Scrap Spawn System

Scrap Areas (coordinate.lua)

Adding New Spawn Areas:

  1. Add new region ID to array

  2. Add vector3 coordinates for each spawn point

  3. Update Config.scrapyardCoords with region center


Scrapyard Zones

Zone Settings:

  • id - Must match Config.scrapArea index

  • coords - Center point of spawn zone

  • radius - How far objects can spawn from center

  • max - Maximum objects allowed in zone

Objects auto-delete when no players are nearby to improve performance.


Scrap Item Distribution

Spawn Weight System:

  • 1-25 - Very rare (big items)

  • 26-50 - Rare (medium items)

  • 51-75 - Common (small-medium items)

  • 76-100 - Very common (small items)


Press Stage Configuration

Press Stages Explained:

  1. Raw Item (_01) - Collectible scrap object

  2. Partially Pressed (_02) - After first press

  3. Fully Pressed (_03) - Ready for shredding


Shredding Output

Output Scaling:

  • Small items: 1-2 metal pieces

  • Medium items: 1-3 metal pieces

  • Large items: 2-4 metal pieces


Drop Zones

Drop Zone Usage:

  • Players can only drop pressed objects near these coordinates

  • Prevents littering across the map

  • Radius check: 5 meters from zone


Processing Machines

Press Machines (coordinate.lua)

Adding New Press Machines:

  1. Copy existing machine config

  2. Increment ID

  3. Update all coordinates to new location

  4. Adjust rotation values for proper alignment

  5. Define press area polygon (8 points = box with height)


Shredding Machines (coordinate.lua)

Shredding Machine Components:

  1. Gears - Visual rotation during processing

  2. Shredding Line - Path items travel during shredding

  3. Case System - Collects shredded metal

  4. Grate - Openable grate for dust collection

  5. Dust System - Accumulates during operation

Case Capacity:

  • 0-5 items: Empty model

  • 6-10 items: Low model

  • 11-15 items: Medium model

  • 16-20 items: Full model


Vehicle System

Vehicle Rental Tiers

Vehicles are configured in coordinate.lua under Config.VehicleRental:

Grid System Explained:

  • w - Width (cells left-right)

  • h - Height (cells front-back)

  • layers - Vertical stacking levels

Example Capacities:

  • Cheap (3x3x2): 18 items max

  • Mid (4x4x3): 48 items max

  • Pro (5x5x4): 100 items max


Vehicle Blips


Reconnection System

Grace Period & Attempts

Grace Period Examples:

  • 0 - Player can reconnect anytime before lobby closes

  • 300 - 5 minutes to reconnect

  • 600 - 10 minutes to reconnect

  • 1800 - 30 minutes to reconnect

Attempt Limit Examples:

  • 0 - Unlimited reconnections

  • 1 - One reconnection only

  • 3 - Three reconnections per session

  • 5 - Five reconnections per session


Owner Transfer

Owner Transfer Logic:

  1. Owner Disconnects β†’ System searches for replacement

  2. Eligibility Check:

    • Player must be in lobby β‰₯ minimumLobbyTime seconds

    • Player must be online (not disconnected)

  3. Priority Selection:

    • If prioritizeByScore = true: Highest score wins

    • If prioritizeByScore = false: Longest lobby time wins

  4. Transfer Complete:

    • New owner assigned

    • Lobby ownership transferred

    • Original owner can rejoin as member if allowRejoinAsMember = true


Notification Settings


Debug Mode

Debug Output:


XP & Progression

Level System

XP Curve:

  • Levels 1-10: 1000-5500 XP per level

  • Levels 11-20: 6000-10500 XP per level

  • Levels 21-50: 11000-25500 XP per level

  • Levels 51-70: 26500-45500 XP per level


XP Sources

Mission Completion:

Daily Missions:

Calculation Example:


Debug & Commands

Debug Mode

Debug Commands:


Tutorial System

Tutorial Requirements:

  • Videos must be .mp4 format

  • Hosted on accessible CDN

  • Recommended resolution: 1920x1080

  • Recommended length: 1-3 minutes


Sell NPCs Configuration

Sellable Legal Items:

  • Iron scrap

  • Gold dust

  • Copper fragments

  • Aluminum pieces

  • Steel bars


Illegal Black Market Dealer

Sellable Illegal Items:

  • Crafted weapons

  • Weapon parts

  • Illegal attachments

  • Contraband materials


Crafting System

Weapon Crafting:

  • Requires illegal area access

  • Uses processed metals

  • Configurable recipes in coordinate.lua

  • Integration with weapon systems

Legal Crafting:

  • Tools and equipment

  • Vehicle parts

  • Construction materials


Performance Optimization

Entity Limits

Optimization Tips:

  • Lower max values in scrapyard zones for better FPS

  • Reduce maxObjects in machines for faster processing

  • Limit concurrent lobbies for lower server load


Common Issues

Framework Not Loading

Problem: [ERROR] Failed to load framework!

Solution:


Vehicle Keys Not Working

Problem: Players can't access rented vehicles

Solution:


Scrap Not Spawning

Problem: No scrap objects appear in world

Solution:

  1. Check player is within radius of scrapyard zone

  2. Verify job has started correctly

  3. Check Config.scrapArea has coordinates

  4. Ensure max limit not reached


Database Errors

Problem: [SQL ERROR] Table doesn't exist

Solution:


Migration Guide

Updating from Old Versions

Config.lua Changes:

Coordinate.lua Changes:


Support & Resources

  • Discord: https://discord.gg/tworst

  • Documentation: https://docs.tworststore.com

  • GitHub Issues: https://github.com/tworst/tw-scrapyard/issues

Configuration Generators

Use online tools to generate coordinates:

  • Vector3 Converter: https://coords.tworststore.com

  • Zone Creator: https://zones.tworststore.com


Advanced Configuration

For advanced topics including:

  • Custom machine creation

  • Network entity optimization

  • Multi-server synchronization

  • Custom crafting recipes

See: Advanced Configuration Guide β†’


Last Updated: November 2024 Version: 2.0.0 Compatibility: FiveM build 2802+

Last updated