FearlessStudios
FiveM ScriptsPaid ScriptsFS-Robberies

Create or edit a vault

Step-by-step guide to adding a custom vault to FS-Robberies.

For current releases, use /robberycreator inside FiveM. Test the door and its loot separately after you save. The Lua examples at the bottom are only for old installs and migration.

Current editing workflow

  1. Grant fsrobberies.creator to the intended admin group.
  2. Open /robberycreator (the default Config.RobberyCreator.Command).
  3. Create or edit the location and vault in the creator. Save, then check the interaction at the door it should control.
  4. Back up data/robberies.json and data/interior_presets.json before updates.

Check that the interaction controls the intended door. Set up loot separately; opening a vault doesn't configure the loot inside it.

Save and verify a current vault

  1. Pick the door layout in the creator: swing, slide, double swing or double slide. Choose the actual door model and save the closed and open poses. For double layouts, configure both doors; for sliding layouts, verify the open position as well. Reopen the creator and check that the saved settings load.
  2. Go to the door and try a robbery with a player who meets the entry requirements. Check that the intended door changes state and appears in the correct closed and open poses.
  3. Try one configured loot point separately. A door that opens does not prove that a loot interaction exists or pays correctly.
  4. If a save says the data changed while you were editing, reopen the creator and review the current record before reapplying your changes.

Read this before migrating an old vault

Skip the rest of this page unless you maintain an older release or are migrating old Lua tables. Current source imports those tables into creator data. It does not include /fs_poly_start or /fs_find_closest_vault_door_coord. If you use a current release, work in the creator above.

Overview

In the older format, define the interaction in Config.CustomLocationRobberies and the managed prop in Config.CustomVaults, both in config.lua. Use the same ID for both entries.

Interior and Door Limits

This older Lua walkthrough covers swinging doors only. The current creator also accepts sliding and double-door layouts. Some interiors may still have placement or visibility problems; the old Paleto Bay default is documented as having view-angle issues with its custom MLO door.

Historical helper setup (older versions only)

Set Config.PolyBuilderPermission and Config.FindVaultPermission in config.lua.

Grant those ACE permissions to your admin group so you can use /fs_poly_start and /fs_find_closest_vault_door_coord.

Capture door data

Stand at the vault door in-game.

Run /fs_find_closest_vault_door_coord and copy the printed model, coords, and heading from your F8 console.

If no door is found, add the door model to Config.VAULT_MODELS in config.lua, then run the command again.

Add the vault door interaction

Add a new entry to Config.CustomLocationRobberies:

Config.CustomLocationRobberies = {
  {
    id = "example_vault_door",
    isVaultDoor = true,
    coords = vec3(123.4567, 456.7890, 21.1234),
    heading = 180.0,
    interactDist = 1.6,
    label = "Example Vault",
    markerZ = 0.55,
    timerMin = Config.Robbery.Vault.Timer.Min,
    timerMax = Config.Robbery.Vault.Timer.Max,
    amountMin = 0,
    amountMax = 0,
    cooldown = Config.Robbery.Vault.Cooldown,
  },
}

Note: amountMin and amountMax must stay 0 for the vault door because opening the door does not grant loot.

Define the vault door

Create a matching entry in Config.CustomVaults. The key must be the same as the location id:

Config.CustomVaults = {
  example_vault_door = {
    hideOriginal = true,
    model = `v_ilev_bk_vaultdoor`,
    spawnPos = vec3(123.4567, 456.7890, 21.1234),
    closedHeading = 180.0,
    openHeading = 50.0,
    durationToOpen = 5,

    insideSphere = { center = vec3(125.0000, 458.0000, 21.2000), radius = 6.5 },
    autoClose = { idleSeconds = 25 },

    insideRobberies = {
      {
        id = "example_deposit_box_1",
        coords = vec3(126.0000, 459.0000, 21.2000),
        heading = 90.0,
        label = "Deposit Box 1",
        amountMin = Config.Robbery.Vault.Rewards.DepositBoxes.MinMoney,
        amountMax = Config.Robbery.Vault.Rewards.DepositBoxes.MaxMoney,
      },
    },
  },
}

Notes:

  • openHeading is an absolute heading. Values will be wrapped to 0-360 when applied, but it is best to keep them in range for clarity.
  • closedHeading follows the same rule as openHeading.
  • insideSphere is the fastest way to get a working vault. Use insidePoly instead for exact interior shapes.
  • insideRobberies entries must have unique id values.

Optional polygon inside zone

If your vault interior is not circular or you want a tighter fit than a sphere, use a polygon to define the inside zone. The polygon is a 2D outline (top-down) with minZ and maxZ defining the vertical range.

When to use insidePoly

  • Your vault is rectangular or irregular.
  • You need the trigger area to follow walls/doors closely.
  • A sphere would include areas outside the vault.

Run /fs_poly_start example_vault_inside.

Left click to add points around the interior.

Use Z to set minZ and X to set maxZ.

Press Enter to finish, then copy the printed Lua table.

Paste the generated insidePoly block into your vault definition, replacing insideSphere.

Min/Max Z Tuning

The generated minZ and maxZ may need manual tuning to fit your vault interior.

Hysteresis

hysteresis is a buffer (in meters) from the boundary required to flip inside/outside, which prevents rapid toggling when players stand on the edge.

Example output from the poly builder:

insidePoly = {
  points = {
    vec3(123.1000, 456.2000, 21.10),
    vec3(124.5000, 456.2500, 21.10),
    vec3(124.4500, 457.8000, 21.10),
    vec3(123.0500, 457.7500, 21.10),
  },
  minZ = 21.10,
  maxZ = 24.10,
  hysteresis = 0.75,
},

Add insidePoly to your vault config

Replace the insideSphere line in your vault with the insidePoly block you generated:

Config.CustomVaults = {
  example_vault_door = {
    hideOriginal = true,
    model = `v_ilev_bk_vaultdoor`,
    spawnPos = vec3(123.4567, 456.7890, 21.1234),
    closedHeading = 180.0,
    openHeading = 50.0,
    durationToOpen = 5,

    insidePoly = {
      points = {
        vec3(123.1000, 456.2000, 21.10),
        vec3(124.5000, 456.2500, 21.10),
        vec3(124.4500, 457.8000, 21.10),
        vec3(123.0500, 457.7500, 21.10),
      },
      minZ = 21.10,
      maxZ = 24.10,
      hysteresis = 0.75,
    },
    autoClose = { idleSeconds = 25 },

    insideRobberies = {
      {
        id = "example_deposit_box_1",
        coords = vec3(126.0000, 459.0000, 21.2000),
        heading = 90.0,
        label = "Deposit Box 1",
        amountMin = Config.Robbery.Vault.Rewards.DepositBoxes.MinMoney,
        amountMax = Config.Robbery.Vault.Rewards.DepositBoxes.MaxMoney,
      },
    },
  },
}

Inspect the result

Set Config.DebugDrawZones = true to visualize inside zones.

Use /openvault to open the nearest vault and verify the inside loot points.

Use /closevault to reset the vault.

Replacing a default vault

If you are replacing a default vault door, set the matching id to false in Config.EnableDefaultVaults and add your custom entries with the same id so you do not get duplicate vault doors.