# FAQ

Common questions and answers about Tworst Scripts.

***

## Purchase & Download

### Where do I download my purchased scripts?

After purchasing from [tworst.com](https://tworst.com), download your scripts from **Cfx.re Portal**:

1. Go to [portal.cfx.re](https://portal.cfx.re)
2. Log in with your Cfx.re account (same account linked during purchase)
3. Click **"Granted Assets"** in the left sidebar
4. Find your script and click **"Download"**

{% hint style="info" %}
**Can't see your purchase?** Make sure you're logged in with the same Cfx.re account that was linked during checkout. If you still have issues, open a ticket on our [Discord](https://discord.gg/tworst).
{% endhint %}

### Do scripts receive updates?

Yes! All Tworst Scripts receive free lifetime updates. Updates are available through the Cfx.re Portal. Join our [Discord](https://discord.gg/tworst) to be notified of new versions.

### Can I use scripts on multiple servers?

Each purchase is licensed for **one server**. For multi-server licensing, contact us on [Discord](https://discord.gg/tworst).

### Can I get a refund?

We offer a **5-day return period** following your purchase. Please note that returns are subject to certain conditions. If you experience any difficulties receiving support within this timeframe, we would be happy to extend the period for you.

For any issues regarding your purchase, please open a support ticket on our [Discord server](https://discord.gg/tworst).

{% hint style="warning" %}
**Note:** Open-source products are not eligible for refund requests.
{% endhint %}

### Is the open-source version fully open?

Yes, our scripts are completely open-source. Only the stream files (assets) are protected under escrow. You can easily view, modify, and adapt the code to your own framework with some modifications.

***

## Installation Issues

### Script won't start / No errors shown

1. Check if the resource is in the correct `resources` folder
2. Verify `ensure tw-scriptname` is in `server.cfg`
3. Check the resource name matches exactly (case-sensitive on Linux)
4. Make sure dependencies start **before** the script:

```cfg
# server.cfg - Correct order
ensure oxmysql
ensure es_extended  # or qb-core
ensure PolyZone
ensure tw-scriptname
```

### "attempt to index a nil value (global 'ESX')" or "QBCore not found"

Your framework isn't loading properly. Check your `config/config.lua`:

```lua
-- Make sure this matches your framework
Config.Framework = 'esx'    -- For ESX servers
Config.Framework = 'qb'     -- For QBCore servers
Config.Framework = 'qbox'   -- For QBox servers
Config.Framework = 'vrp'    -- For vRP servers
```

### "No such export" error

Missing dependency. Check that you have:

* **PolyZone** - Required for all scripts
* **oxmysql** - Or mysql-async/ghmattimysql
* Your framework (ESX/QBCore/vRP)

### SQL import fails

* Make sure you're importing to the correct database
* Check for existing tables that might conflict
* The SQL file is named `insert.sql` in the script folder

### PolyZone errors

Make sure PolyZone is installed and started before Tworst scripts:

```cfg
ensure PolyZone
ensure tw-scriptname
```

Download PolyZone from: [GitHub](https://github.com/mkafrin/PolyZone)

***

## Configuration Problems

### Changes to config don't apply

1. Save the file
2. Restart the resource: `ensure tw-scriptname`
3. Or restart the entire server
4. Check for syntax errors in config

### "attempt to call a nil value" in config

Syntax error in your config. Check for:

* Missing commas between values
* Unclosed brackets `{}` or parentheses `()`
* Mismatched quotes `"` or `'`

```lua
-- Wrong
Config.Setting = 'value'
Config.Other = true   -- Missing comma above!

-- Correct
Config.Setting = 'value',
Config.Other = true,
```

### How do I change the language?

```lua
Config.Locale = 'en'  -- English
Config.Locale = 'tr'  -- Turkish
Config.Locale = 'de'  -- German
Config.Locale = 'fr'  -- French
Config.Locale = 'pt'  -- Portuguese
Config.Locale = 'ru'  -- Russian
Config.Locale = 'ar'  -- Arabic
```

Available languages are in the `locales/` folder.

### How do I change the interaction system?

```lua
Config.InteractionHandler = 'drawtext'  -- Default (no target needed)
Config.InteractionHandler = 'qb-target' -- For qb-target users
Config.InteractionHandler = 'ox-target' -- For ox_target users
```

### How do I change the inventory system?

```lua
Config.Inventory = 'qb_inventory'   -- QBCore Inventory
Config.Inventory = 'ox_inventory'   -- ox_inventory
Config.Inventory = 'qs_inventory'   -- qs-inventory
Config.Inventory = 'esx_inventory'  -- ESX Inventory
```

***

## In-Game Issues

### UI doesn't appear

1. Press **F8** and check the NUI tab for JavaScript errors
2. Clear FiveM cache: Delete `%localappdata%/FiveM/FiveM.app/data/cache`
3. Verify `html/` folder exists in the resource
4. Check if another script is blocking NUI

### Job menu doesn't open

1. Check if you're at the correct location (coordinates in config)
2. Verify your interaction system is configured correctly
3. Enable `Config.Debug = true` to see console messages
4. Check if blips/markers are showing

### Markers/Blips don't show

1. Check coordinates in `config/coordinate.lua`
2. Verify blip settings are enabled
3. Check for coordinate conflicts with other scripts

### Vehicles don't spawn

1. Check vehicle model names are correct
2. Verify vehicle key system is configured:

```lua
Config.Vehiclekey = true
Config.VehicleSystem = "qb-vehiclekeys"  -- Your vehicle key resource
```

### Database not saving

1. Check oxmysql/mysql-async is running
2. Verify database credentials in `server.cfg`
3. Check server console for SQL errors
4. Make sure the table was imported from `insert.sql`

***

## Performance

### Script causing lag

1. Set `Config.Debug = false` in production
2. Check for conflicts with other resources
3. Reduce draw distances if configurable
4. Use `resmon` command to check resource usage

### High resource monitor (resmon) usage

Higher usage is normal during:

* Initial script load
* Many players using the script simultaneously
* Debug mode enabled

If usage remains high, check for conflicts or contact support.

***

## Framework Specific

### ESX: Player data not loading

Make sure ESX is exporting correctly:

```lua
Config.Framework = 'esx'
-- For older ESX versions:
Config.Framework = 'oldesx'
```

### QBCore: Functions not working

Make sure QBCore is configured:

```lua
Config.Framework = 'qb'
-- For older QBCore versions:
Config.Framework = 'oldqb'
```

### QBox: Compatibility issues

QBox is fully supported:

```lua
Config.Framework = 'qbox'
```

### vRP: Integration problems

vRP support is available for job scripts:

```lua
Config.Framework = 'vrp'
```

***

## Support

### How can I contact support?

The fastest way to get help is through our [Discord server](https://discord.gg/tworst) where we're available 7 days a week.

**Contact Options:**

* **Discord** - Fastest way to get one-on-one support, 7 days a week
* **Email** - Send us an email at <support@tworst.com> (3-5 business days)
* **YouTube** - Watch video tutorials and installation guides

### The script is not working, what should I do?

1. Check this FAQ and our troubleshooting guides
2. Make sure all dependencies are installed correctly
3. If the issue persists, join our [Discord server](https://discord.gg/tworst) and create a support ticket with your server console errors

### What information should I include in a support ticket?

* **Script name** and version
* **Framework** (ESX/QBCore/QBox/vRP) and version
* **Full error message** from server console (F8)
* **Steps to reproduce** the issue
* **Config changes** you made
* **Screenshots** if applicable

{% hint style="warning" %}
Support tickets without proper information may take longer to resolve. Please provide all relevant details.
{% endhint %}

***

## Still Need Help?

{% hint style="info" %}
Can't find your answer? Join our [Discord server](https://discord.gg/tworst) and open a support ticket. Our team is available 7 days a week!
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tworst.com/getting-started/faq.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
