> For the complete documentation index, see [llms.txt](https://sl-scritps.gitbook.io/sl-scripts-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sl-scritps.gitbook.io/sl-scripts-documentation/installation.md).

# Installation

## Installation

This page explains the standard installation process for SL Scripts resources.

Each product may have specific requirements, but this guide covers the common installation flow used by most SL Scripts resources.

***

### 1. Download the resource

Download the resource from Tebex / CFX Asset Delivery.

After downloading, you should have a resource folder similar to:

```txt
sl_resource_name
```

Example:

```txt
sl_smartwatch
sl_vintage_jukebox
sl_coffee_stand
sl_fight_club
```

***

### 2. Place the resource in your server

Move the resource folder into your FiveM server resources folder.

Example:

```txt
resources/[sl_scripts]/sl_smartwatch
```

You may organize SL Scripts resources inside a folder such as:

```txt
resources/[sl_scripts]/
```

Example:

```txt
resources/[sl_scripts]/sl_smartwatch
resources/[sl_scripts]/sl_vintage_jukebox
resources/[sl_scripts]/sl_coffee_stand
```

***

### 3. Keep the folder name correct

Do not rename the resource folder unless the product documentation says it is safe.

The folder name is important because some resources may reference internal files, NUI paths, exports or Asset Escrow data.

Wrong folder names may cause:

* Resource startup errors
* Missing UI files
* NUI not opening
* Asset Escrow entitlement issues
* Config not loading correctly

***

### 4. Check dependencies

Before starting the resource, check the product page for required dependencies.

Common dependencies may include:

* `ox_lib`
* `oxmysql`
* `ox_inventory`
* `ox_target`
* `qb-target`
* QBCore
* Qbox
* ESX

Some SL Scripts resources are standalone and do not require a framework.

Optional integrations are usually configured in `config.lua` or `custom.lua`.

***

### 5. Configure `config.lua`

Open:

```txt
config.lua
```

Review the main options before starting the resource.

Common settings include:

* Locale / language
* Framework mode
* Inventory mode
* Target mode
* Commands
* Permissions
* Distances
* Debug mode
* Webhooks
* Feature toggles

Recommended:

```lua
Config.Debug = false
```

Use debug mode only while testing or troubleshooting.

***

### 6. Configure `custom.lua` if needed

Open:

```txt
custom.lua
```

This file is used for server-specific integrations.

Use it when your server has:

* Custom notify system
* Custom inventory
* Custom framework functions
* Custom permission logic
* Custom banking system
* Custom job checks

If your server uses standard QBCore, Qbox, ESX or standalone mode, you may not need to edit much here.

***

### 7. Import SQL if required

Some resources require database tables.

If the resource includes:

```txt
sql/install.sql
```

import it into your database before starting the resource, unless the product page says automatic migrations are enough.

Recommended database tool examples:

* HeidiSQL
* phpMyAdmin
* DBeaver
* txAdmin database tools if available

Make sure `oxmysql` starts before any resource that needs database access.

***

### 8. Add the resource to `server.cfg`

Open your `server.cfg` and add the resource after its dependencies.

Example:

```cfg
ensure oxmysql
ensure ox_lib
ensure ox_inventory
ensure ox_target

ensure sl_smartwatch
```

If you keep SL Scripts resources inside a grouped folder, still ensure each resource by its folder name.

Example:

```cfg
ensure sl_coffee_stand
ensure sl_vintage_jukebox
ensure sl_fight_club
```

***

### 9. Restart the server

After adding the resource to `server.cfg`, restart your server.

You can also test with:

```cfg
ensure sl_resource_name
```

or restart the resource from the server console:

```txt
restart sl_resource_name
```

A full server restart is recommended after first installation.

***

### 10. Check startup logs

When the resource starts correctly, you may see a startup message in the server console or client F8 console.

Example:

```txt
[sl_resource_name][INFO] Server ready: Product Name vX.X.X
[sl_resource_name][INFO] Client ready: Product Name vX.X.X
```

Some resources also show the main command.

Example:

```txt
[sl_smartwatch][INFO] Client ready: SL Smartwatch GPS v1.8.14 | Use /smartwatch
```

***

### 11. Test in game

After installation, join your server and test the main flow.

Check:

* Main command
* Main item if required
* Target interaction if required
* UI open and close
* Admin access
* Player access
* Database saving if required
* Console errors
* F8 errors

***

### 12. Common install issues

#### Resource does not start

Check:

```txt
- Folder name is correct
- fxmanifest.lua exists
- Resource is added to server.cfg
- Dependencies are started first
- Server console does not show missing file errors
```

#### UI does not open

Check:

```txt
- web/ folder exists if the resource uses NUI
- ui_page is correctly declared in fxmanifest.lua
- F8 console does not show JavaScript errors
- Resource folder name was not changed
```

#### SQL errors

Check:

```txt
- oxmysql is installed
- oxmysql starts before the resource
- Database connection is working
- sql/install.sql was imported if required
```

#### Target does not appear

Check:

```txt
- ox_target or qb-target is started
- Target mode is enabled in config.lua
- You are close enough to the interaction
- Your job/permission allows access
```

#### Item does not work

Check:

```txt
- Item exists in your inventory system
- Item name matches config.lua
- Inventory bridge is configured
- Server console does not show inventory errors
```

***

### Recommended install order

For most servers:

```cfg
ensure oxmysql
ensure ox_lib
ensure ox_inventory
ensure ox_target

ensure sl_resource_name
```

For QBCore/Qbox/ESX servers, make sure your framework starts before SL Scripts resources that use framework features.

***

### Next step

After installation, go to the product page for the resource you installed.

Each product page explains:

* How to use the script
* Commands
* Permissions
* Admin options
* Player flow
* Product-specific troubleshooting


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://sl-scritps.gitbook.io/sl-scripts-documentation/installation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
