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

# Updating

Keeping your scripts up to date gets you the latest features, fixes and performance improvements. This guide works for **every 5scripts resource** - the process is the same across the board.

{% hint style="warning" %}
**Don't overwrite your whole config.** Every update we tell you exactly what changed. You only need to add the **new** values - never rebuild your `config.lua` from scratch, or you'll lose all your customizations. More on this below.
{% endhint %}

## 1. Download the latest version

All of our scripts are delivered through **CFX (Keymaster)**. To grab the newest build:

1. Log in to the CFX portal: [portal.cfx.re](https://portal.cfx.re/)
2. Go to your **Granted Assets** (the assets tied to your CFX account)
3. Find the script and download the latest version

{% hint style="info" %}
The version on the portal always matches the latest release. If you don't see the newest version yet, give it a few minutes and refresh.
{% endhint %}

## 2. Read the changelog first

Before touching anything, read the changelog for the version you're moving to. We post every release in the **#updates** channel on our [support Discord](https://discord.gg/EsFUZjSSwu).

Each changelog tells you everything you need to plan the update:

* **New Features** - what's new and whether you want to enable it
* **Config Changes / New Config Options** - the exact values you need to add to your config (see step 4)
* **Bug Fixes** - what was broken and is now fixed
* **Changed files** - the files that were modified in this release
* **New files** - files that didn't exist before and need to be added

> Example of what a release entry looks like:
>
> ```
> New version: 5s_zombies
> New Config Options
>   Config.zombiesBlipShowHeading - Toggle whether zombie blips show heading (default: true)
> Changed files:
>   client/editable/events.lua
>   client/main/behaviour.lua
>   config.lua
>   fxmanifest.lua
> Version: 1.8.1
> ```

The **Changed files** and **New files** lists are your checklist - if a file isn't on either list, you don't need to touch it.

## 3. Back up your current install

Before replacing anything, copy your existing resource folder somewhere safe. If something goes wrong, you can roll straight back.

Pay special attention to files you've edited yourself:

* `config.lua`
* Anything inside `editable/` folders (e.g. `server/editable/`, `client/editable/`)
* `locales/` files if you translated or customized them

## 4. Replace the resource files

How much you swap out depends on what you've changed.

### The main resource

Delete the old resource folder and drop in the new one, **then bring back your customizations**:

1. Replace the whole folder with the new version.
2. Re-apply your `config.lua` values (see step 5 - don't just paste your old file back).
3. Re-apply any changes you made inside `editable/` folders that appear in the changelog's **Changed files** list. If an editable file was **not** changed in this release, your version is safe to keep as-is.

{% hint style="info" %}
Only files listed under **Changed files** in the changelog were actually modified. If you edited an editable file that the update didn't touch, you can keep your version - just compare it against the new one to be safe.
{% endhint %}

### Asset & dependency folders

Some scripts ship as **more than one folder** - a main resource plus one or more separate folders that only hold assets or a dependency. For example, `5s_skinmenu` ships alongside `fivem-greenscreener`, and `5s_building` ships with `5s_building_assets`, `5s_doors_assets` and `5s_building_sounds`.

If you **never edited** these asset/dependency folders (and most people don't), you can safely replace them **as a whole** with the new versions - there's nothing of yours to preserve inside them. Only worry about merging changes for folders you've actually modified.

## 5. Update your config the smart way

This is the step people get wrong most often. **You do not need to rebuild your config.**

We design our updates so that your existing config keeps working. When a release adds a new option, the changelog lists it under **Config Changes** or **New Config Options**, along with its default value.

**What to do:**

1. Open the changelog and find the **New Config Options** section.
2. For each new option, add just that line to your existing `config.lua`, using the documented default (or your own preferred value).
3. Leave everything else in your config exactly as it is.

**Example** - if a changelog says:

```
New Config Options
  Config.debug - Enable extra debug output to server console (default: false)
```

You simply add this one line to your existing config:

```lua
Config.debug = false
```

That's it. No need to copy the entire new `config.lua` over your own.

{% hint style="danger" %}
Pasting the fresh `config.lua` over yours will **wipe every setting you've customized**. Add the new values by hand instead - it takes seconds and keeps your setup intact.
{% endhint %}

## 6. Restart and verify

1. Restart the resource (or your server).
2. Watch the server console on startup for any errors.
3. Confirm the version loaded matches the one you just installed.

{% hint style="success" %}
**Database updates are automatic.** Just like on a fresh install, any new tables or columns are created for you when the server starts - there's nothing to import by hand and no risk of data loss. See [Database](/docs/installation/database.md) for details.
{% endhint %}

## Quick checklist

* [ ] Downloaded the latest version from [portal.cfx.re](https://portal.cfx.re/)
* [ ] Read the changelog in the Discord **#updates** channel
* [ ] Backed up my current folder, config and editable files
* [ ] Replaced the resource files (and asset/dependency folders if untouched)
* [ ] Added **only the new** config values from the changelog
* [ ] Restarted and checked the console for errors

Still stuck? Open a ticket on our [support Discord](https://discord.gg/EsFUZjSSwu) and we'll help you out.
