Troubleshooting Guide

This guide covers common issues and solutions for both noclip_crafting and noclip_drugs scripts.

Before troubleshooting: Make sure you have the latest version of the script and all dependencies are properly installed.

General Issues

Script Not Starting

Symptoms

  • Script doesn't appear in server console
  • Error messages about missing dependencies
  • Resource fails to start

Solutions

  1. Check Dependencies: Ensure all required resources are installed and started:
    • qb-core
    • ox_lib
    • ox_target
    • ox_inventory (optional for noclip_drugs)
  2. Check Resource Order: Make sure the script is started after dependencies in your server.cfg
  3. Verify File Structure: Ensure all files are in the correct location and not corrupted
  4. Check Console Errors: Look for specific error messages in the server console

Performance Issues

Symptoms

  • Server lag when using the script
  • High CPU usage
  • Slow response times

Solutions

  1. Enable Debug Mode: Set Config.Debug = false in production
  2. Check Resource Usage: Monitor server performance with the script enabled/disabled
  3. Optimize Configuration: Reduce the number of locations or simplify recipes
  4. Update Dependencies: Ensure all OX resources are up to date

noclip_crafting Specific Issues

For detailed noclip_crafting troubleshooting: See the dedicated troubleshooting guide which includes recent fixes and improvements.

Crafting Menu Not Opening

Symptoms

  • No ox_target interaction appears
  • Menu opens but shows no recipes
  • Error messages in console

Solutions

  1. Check ox_target: Ensure ox_target is properly installed and configured
  2. Verify Coordinates: Check that crafting location coordinates are correct
  3. Check Job Restrictions: Ensure player has the required job/grade
  4. Verify Item Requirements: Check if player has required items for the location
  5. Check ox_inventory Items: Ensure all recipe items exist in ox_inventory

Items Not Being Given/Removed

Symptoms

  • Items not removed from inventory during crafting
  • Crafted items not appearing in inventory
  • Inventory full errors

Solutions

  1. Check ox_inventory Integration: Verify ox_inventory is properly configured
  2. Check Item Names: Ensure item names match exactly between config and ox_inventory
  3. Verify Inventory Space: Check if player has enough inventory space
  4. Check Item Weight: Ensure items don't exceed weight limits
  5. Enable Debug Mode: Set Config.Debug = true to see detailed logs

Skill System Issues

Symptoms

  • Skills not leveling up
  • Experience not being saved
  • Skill requirements not working

Solutions

  1. Check Skill System: Ensure Config.SkillSystem.enabled = true
  2. Verify Experience Gain: Check that recipes have expGain values set
  3. Check Level Requirements: Ensure levelRequirement is set correctly
  4. Check File Permissions: Ensure the script can write to the data directory
  5. Reset Skills: Use admin command to reset player skills if corrupted

noclip_drugs Specific Issues

Harvesting Not Working

Symptoms

  • No harvest interaction available

Solutions

  1. Check Harvest Locations: Verify coordinates in Config.HarvestLocations
  2. Check ox_target: Ensure ox_target is working properly
  3. Verify Item Configuration: Check that harvest items exist in ox_inventory
  4. Check Radius Settings: Ensure harvest radius is appropriate

Drug Selling Issues

Symptoms

  • /selldrugs command not working
  • No peds responding to drug offers
  • Police alerts not working

Solutions

  1. Check Command Registration: Verify the command is properly registered
  2. Check Sellable Drugs: Ensure drugs are in Config.SellableDrugs
  3. Verify Police Integration: Check ps-dispatch configuration
  4. Check Ped Spawning: Ensure peds are spawning correctly
  5. Check Reaction Chances: Verify ped reaction configuration

Addiction System Issues

Symptoms

  • Addictions not being tracked
  • Withdrawal effects not working
  • Cure items not working

Solutions

  1. Check Addiction Configuration: Verify addiction thresholds in config
  2. Check Drug Effects: Ensure drug effects are properly configured
  3. Verify Cure Items: Check that cure items exist in ox_inventory
  4. Check Data Persistence: Ensure addiction data is being saved
  5. Use Admin Commands: Use /addictioninfo to check player status

Drug Effects Not Working

Symptoms

  • Drug consumption has no effects
  • Effects not persisting across restarts
  • Visual effects not appearing

Solutions

  1. Check Drug Configuration: Verify drug effects in Consumables.Drugs
  2. Check Effect Values: Ensure effect values are within valid ranges
  3. Verify Animations: Check that animations are properly configured
  4. Check Influence Persistence: Ensure influence system is enabled
  5. Check Client Events: Verify client-side events are firing

Common Error Messages

Server-Side Errors

"QBCore not found"

Solution: Ensure QBCore is started before the script in server.cfg

"ox_inventory not found"

Solution: Install ox_inventory or set Config.UseOxInventory = false

"Invalid item name"

Solution: Check that item names match exactly between config and ox_inventory

"Player not found"

Solution: Ensure player is properly loaded before calling exports

Client-Side Errors

"ox_target not found"

Solution: Ensure ox_target is properly installed and started

"ox_lib not found"

Solution: Install and configure ox_lib properly

"Invalid coordinates"

Solution: Check that all coordinates in config are valid vector4 values

Debugging Tips

Enable Debug Mode

Set Config.Debug = true in your config file to get detailed logging:

Config = {}
Config.Debug = true  -- Enable detailed logging

Check Server Console

Monitor the server console for error messages and debug information when issues occur.

Use Admin Commands

Both scripts include admin commands for debugging:

  • noclip_crafting: /craftingdebug, /resetskills [player_id]
  • noclip_drugs: /addictioninfo [player_id], /cureaddiction [player_id] [drug_type]

Check File Permissions

Ensure the script has read/write permissions for its data directory.

Getting Help

If you're still experiencing issues after trying these solutions:

  1. Check the GitHub Issues: Search for similar problems in the repository
  2. Enable Debug Mode: Get detailed logs to help identify the issue
  3. Provide Information: When asking for help, include:
    • Script version
    • Dependency versions
    • Error messages
    • Configuration snippets
    • Steps to reproduce the issue
  4. Contact Support: Reach out through GitHub or Discord
Remember: Most issues can be resolved by checking dependencies, configuration, and enabling debug mode for detailed logging.