❓・Common Errors

Common Errors

Here you will find common errors and their solutions. If you have any further questions, please feel free to ask in the Discord (opens in a new tab).

This page is still under construction. If you have any errors that are not listed here, please let us know in the Discord (opens in a new tab).

General Errors

 attempt to index a nil value (global 'lib')

If you get this error you either don't have ox_lib (opens in a new tab) installed on your server or you start it after the it-drugs script. Make sure to start the ox_lib script before the it-drugs script.

Database Errors

 Error: it-drugs was unable to execute query!

If you get this error, it means that the script was unable to execute a query on the database. This can have multiple reasons, but the most commons are:

  • You still running version 1.2.4 of the script. Update now (opens in a new tab)
  • You updated the script from 1.2.4 to 1.3.x and didn't update the database. To fix this you can run the following SQL query:
    -- Delete the drug_plants table
    DROP TABLE IF EXISTS drug_plants;
    -- Delete the drug_processing table
    DROP TABLE IF EXISTS drug_processing;

Any other databse error

If you get any other database error, please make sure that you are using the latest version of the script.

If you are using the latest version of the script, please let us know in the Discord (opens in a new tab).

Animation Error

Missing Animation

 attempt to index a nil value (field 'animation')

If you get this error that means you are using 1.2.4 of the script. We would recommend updating to the latest version of the script. This will fix the error.

Loading...

However, if you want to fix it manually, you can do the following:

Open the config.lua file.

Search for Config.ProcessingTables.

Add the following lines to every recipe in every processing tables:

animation = {
    dict = 'anim@gangops@facility@servers@bodysearch@',
    anim = 'player_search',
},

Planting Errors

 [ERROR] [getPlantByNetId] - Plant with netId: 0 does not exists!

If you get this error, it means that the script was unable to find the plant with the given netId. In most cases, this error occurs when a player try to interact with a plant that is not managed by the script. So in most cases you can ignore this error.

Selling Errors

Can't sell drugs to npc

If yoo can't sell drugs to a NPC make sure your are in on of the zones that are defined in the Config.SellZones in the config.lua file. If you are in one of the zones and still can't sell drugs to the NPC, please make sure that you are using the latest version of the script. Also you can enable Config.ManualZoneChecker in the config.lua file to check the zones manually.