The Lab
Install guide

How to install a RedM script

Every RedM resource installs the same way at heart: a folder in resources, its dependencies running, and an ensure line in server.cfg. What varies is the database and inventory work around it. This checklist covers the whole path, whatever the script.

Estimated time: 15 min

Before you start

  • A working RedM server (FXServer, usually managed by txAdmin)
  • File access to the server (local disk, SFTP or your host's file manager)
  • Database access if the script stores data

Install steps

  1. Step 1: Get the files

    Paid, escrowed scripts are downloaded from the Cfx.re portal (formerly Keymaster) with the account that bought them. Free scripts usually come from a GitHub release. Prefer release archives over a copy of the repository: releases often include built web files that the source does not.

  2. Step 2: Put the folder in resources

    The folder name is the resource name used in server.cfg. Bracketed folders like [scripts] are categories: FXServer scans inside them, so you can group resources without changing their names.

    resources/
      [framework]/
      [scripts]/
        my-script/
          fxmanifest.lua
  3. Step 3: Read the fxmanifest

    fxmanifest.lua tells you what the resource needs. dependencies lists resources that must be present; a line like '@oxmysql/lib/MySQL.lua' in server_scripts means it uses oxmysql even if it is not listed as a dependency.

    server_scripts {
        '@oxmysql/lib/MySQL.lua',
        'server/main.lua',
    }
    
    dependencies {
        'oxmysql',
    }
  4. Step 4: Run the SQL and add items

    Look for an installation, sql or install folder. Import SQL files into the database your framework uses. Item definitions go wherever your inventory reads them: the items table for VORP, rsg-core/shared/items.lua for RSG.

  5. Step 5: Add the ensure line

    Put it after everything the script depends on. If the script detects your framework automatically, it must come after the framework too.

    ensure oxmysql
    # framework resources...
    ensure my-script
  6. Step 6: Load it

    On a fresh boot the new line is read automatically. On a running server, type refresh in the server console so FXServer sees the new folder, then ensure my-script. Restarting a framework resource live is risky; restart the whole server when in doubt.

    refresh
    ensure my-script
  7. Step 7: Read the console

    Watch the server console for errors when the resource starts, and the client console (F8) once you join. Most problems show up there in plain words: a missing dependency, an unknown table or a missing item.

Troubleshooting

"Couldn't find resource"

The folder name does not match the ensure line, or the folder is nested one level too deep (a folder inside a folder after extraction).

The UI is blank

The built web files (often app/, html/ or web/build/) are missing. Download the release archive, not the source.

Works after a restart but not on a cold boot

Start order. The script starts before something it needs. See the ensure order guide.

FAQ

What is the difference between start and ensure?

start starts a stopped resource. ensure starts it, or restarts it if it is already running, which is why server.cfg files use ensure.

Can I rename a resource folder?

Only if nothing refers to it by name. Other resources call exports and events by resource name, and escrowed resources are best kept as delivered.

Do I need to restart the server for every new script?

No, refresh then ensure works for most scripts. Restart fully if the script hooks into the framework at boot.