Getting started
Everything every Swarm script needs: Swarm Bridge, the right start order and, for the licensed edition, your ServerSecret.
What is Swarm Bridge?
Swarm Bridge (swarm_bridge) is one shared resource that every Swarm script needs. Instead of each script talking to your framework, inventory, target, notifications, dispatch, vehicle keys, fuel and so on directly, they all go through the bridge. That means:
- One place to set things up. Swarm Bridge detects what your server runs, so most servers change nothing.
- One language setting for every Swarm script. See Languages.
- In the licensed edition, one ServerSecret unlocks every Swarm script you own.
A copy of swarm_bridge comes with every Swarm script. You only need one copy on your server; if you have several, keep the newest.
Install order
Start things in this order in server.cfg: your database and framework first, then Swarm Bridge, then the Swarm scripts.
# 1. Database, framework and shared resources
ensure ox_lib
ensure oxmysql
ensure qbx_core # or qb-core / es_extended
ensure ox_inventory
ensure ox_target
# 2. Swarm Bridge
ensure swarm_bridge
# 3. Your Swarm scripts
ensure swarm_fishing
ensure swarm_mining
# ...
- Copy
swarm_bridgeand your scripts into yourresourcesfolder. - Add the
ensurelines above, in that order. Each script's own page lists exactly what it needs. - Give your staff the bridge admin permission:
add_ace group.admin swarm.admin allow - Licensed edition: add your ServerSecret (next section).
- Start the server, then run
swarmbridge_statusin the server console to see what the bridge detected.
oxmysql must start before swarm_bridge. If it doesn't, scripts can't load or save their data.
Your ServerSecret (licensed edition)
The licensed edition checks your licence through Swarm Bridge. You need one ServerSecret per server, and it unlocks every Swarm script you own.
- Sign in to the Client Area.
- Open any of your Swarm licences and choose Add server. Copy the ServerSecret it gives you.
- Open
swarm_bridge/licence/private_config.luaand paste it between the quotes:PrivateConfig = { Api = { BaseURL = '...', -- leave this as it ships ServerSecret = 'paste-your-secret-here' } } - Restart the server. Swarm Bridge checks the licence when it starts.
Treat the ServerSecret like a password. Don't share it, post it in Discord or put it in screenshots. private_config.lua is a server-only file, so keep it that way.
Source edition vs licensed edition
| Licensed | Source Code | |
|---|---|---|
| Licence check | Yes, through Swarm Bridge | None |
| ServerSecret | Needed, in swarm_bridge/licence/private_config.lua | Not needed. There is no licence folder. |
| Swarm Bridge | Required | Included and used by the scripts the same way |
| Code | Config and language files are yours to edit | Full readable source, yours to modify |
Everything else on these docs pages (install order, config, commands, languages) is the same for both editions.
Supported frameworks and resources
Swarm Bridge detects all of these automatically. Every setting below is 'auto' in swarm_bridge/config.lua. Only force a value if detection picks the wrong one, for example with a renamed fork.
| What | Setting | Options |
|---|---|---|
| Framework | SwarmConfig.Framework | qbox, qbcore, esx, standalone |
| Inventory | SwarmConfig.Inventory | ox_inventory, qb_inventory, qs_inventory, ps_inventory, origen_inventory, codem_inventory, core_inventory, tgiann_inventory, jaksam_inventory, framework, standalone |
| Target | SwarmConfig.Target | ox_target, qb_target, none |
| Notifications | SwarmConfig.Notify | ox_lib, qbox, qbcore, esx, native |
| Dispatch | SwarmConfig.Dispatch | ps_dispatch, qs_dispatch, wasabi_mdt, origen_police, cd_dispatch, custom, none |
| Police | SwarmConfig.Police | wasabi_police, origen_police, framework, none |
| Vehicle keys | SwarmConfig.VehicleKeys | qb_vehiclekeys, qs_vehiclekeys, renewed_vehiclekeys, custom, none |
| Fuel | SwarmConfig.Fuel | ox_fuel, legacyfuel, ps_fuel, none |
| Mileage | SwarmConfig.Mechanic | jg_vehiclemileage, none (none uses the bridge's own mileage tracker) |
| Appearance | SwarmConfig.Appearance | auto, illenium_appearance, fivem_appearance, none |
SwarmConfig.Appearance ships set to 'illenium_appearance', not 'auto'. If you don't run illenium-appearance, change it to 'auto', 'fivem_appearance' or 'none'.
Using custom for dispatch or vehicle keys? Fill in the event names under SwarmConfig.Custom.
Other Swarm Bridge settings
| Setting | What it does |
|---|---|
SwarmConfig.Locale | Language for every Swarm script. See Languages. |
SwarmConfig.AdminAce | ACE checked by the bridge admin commands (swarm.admin by default). |
SwarmConfig.LawEnforcement.jobs | Jobs that count as police for police counts and dispatch (police, sheriff, bcso, lspd by default). |
SwarmConfig.Discord.enabled / webhook | Optional Discord logging. Off and empty by default. |
SwarmConfig.Branding | Server name and wordmark for Swarm screens such as the loading screen and character select. Defaults to your sv_hostname. |
SwarmConfig.Scripts | Off switches for individual scripts, for example LoadingScreen and MultiChar. |
SwarmConfig.ItemCurrencyDefaults | How item currencies such as markedbills store their value (the worth metadata). |
Bridge commands
| Command | Who | What it does |
|---|---|---|
/swarmbridge | Everyone | Shows the bridge version and what it detected. |
swarmbridge_status | Console or admin | Full diagnostics of every detected resource. |
/swarmbridge_currency [item] | Admin, in game | Compares the stack count and stored value of a currency item (markedbills by default). |
/swarmbridge_debug | Admin | Turns bridge debug output on or off. |
Troubleshooting the licence check
- Your server must be able to reach swarm-scripts.com. If a firewall or host blocks outgoing connections, the check can't complete.
- It re-checks every 6 hours while the server is running, as well as at start-up.
- Short outages are fine. If swarm-scripts.com can't be reached, your scripts keep working for up to 3 days before the check has to succeed again.
- Check the secret. Paste it exactly, between the quotes, with no extra spaces, in
swarm_bridge/licence/private_config.lua. - Check your licence is active in the Client Area.
- Check the start order.
swarm_bridgemust start before every Swarm script. - Read the server console at start-up. Look for
[SwarmBridge] Licence verified. If it says a script isn't licensed for this server, check that you own an active licence for that script.
Still stuck? Check the service status or ask in Discord.
SwarmAC
SwarmAC, our anticheat, is set up differently. It doesn't use Swarm Bridge and has its own server/private_config.lua and its own install steps. It needs screenshot-basic (started before it) and OneSync. Staff permissions are swarmac.command for the staff commands and swarmac.bypass for detection immunity; only give swarmac.bypass to staff who really need it. Follow the README that ships with SwarmAC, or ask in Discord.
Need help?
Ask in the Swarm Scripts Discord.
Swarm Scripts
Nyxia Development