Add Shells

  • The script have a built in tool to create new shells, is not perfect and you may need to adjust some coords or heading for certain objects but is pretty easy.

1) Set your Config.DevServer = true

2) Go to config/_shells.lua and copy the format from any other shell, I'm gonna take the one from LowApt:

['LowApt'] = { -- This is the key index
    label = "Low Apartment", -- Label to display in creator menu
    shell = `furnitured_lowapart`, -- Shell object name
    z = 25.0, -- How far down should be spawned
    door = {x = 4.91, y = -1.06, z = 3.33, heading = -2.95},
    objects = {
        {type = "alarm", prop = 'v_res_tre_alarmbox', x = 6.14, y = -1.65, z = 3.15, heading = -180.44, label = "Hack", icon = "fa-solid fa-laptop-code"}, -- Alarm don't remove it
        {type = "safe", prop = 'ch_prop_ch_arcade_safe_door', x = -4.33, y = 1.80, z = 3.20, heading = 90.0, label = "Crack", icon = "fa-solid fa-vault"}, -- it spawns randomly
        {type = "item", prop = 'prop_tv_04', x = 2.69, y = -2.09, z = 2.60, heading = 0.0, itemName = "low_end_tv", label = "Grab", icon = "fa-solid fa-user-ninja"},
        {type = "item", prop = 'prop_tv_03', x = -3.54, y = 4.60, z = 2.80, heading = 45.0, itemName = "low_end_tv", label = "Grab", icon = "fa-solid fa-user-ninja"},
        {type = "item", prop = 'ch_prop_ch_wallart_01a', x = -1.14, y = -4.01, z = 3.30, heading = 90.0, itemName = "low_end_art", label = "Grab", icon = "fa-solid fa-user-ninja"},
        {type = "item", prop = 'as_prop_as_speakerdock', x = 3.15, y = 4.93, z = 2.97, heading = 0.0, itemName = "ipod", label = "Grab", icon = "fa-solid fa-user-ninja"},
        {type = "item", prop = 'prop_toaster_02', x = 6.24, y = 2.84, z = 2.97, heading = 0.0, itemName = "toaster", label = "Grab", icon = "fa-solid fa-user-ninja"},
    },
    zones = {
        {x = 6.08, y = -0.02, z = 2.11, heading = -267.99, label = "Search", icon = "fa-solid fa-magnifying-glass"},
        {x = -3.31, y = -1.55, z = 2.10, heading = -179.23, label = "Search", icon = "fa-solid fa-magnifying-glass"},
        {x = 1.23, y = -2.14, z = 2.05, heading = -2.50, label = "Search", icon = "fa-solid fa-magnifying-glass"},
    },
},

3) We need to change the key index to an unique name and change the label to something we can identify easily, change the shell name to your own and depending of the shell height you can set how far down it should spawn, normally 25.0 is fine... The code should look like this:

['Example'] = { -- This is the key index
    label = "Example Shell", -- Label to display in creator menu
    shell = `modernhotel_shell`, -- Shell object name
    z = 25.0, -- How far down should be spawned
    door = {x = 4.91, y = -1.06, z = 3.33, heading = -2.95},
    objects = {
        {type = "alarm", prop = 'v_res_tre_alarmbox', x = 6.14, y = -1.65, z = 3.15, heading = -180.44, label = "Hack", icon = "fa-solid fa-laptop-code"}, -- Alarm don't remove it
        {type = "safe", prop = 'ch_prop_ch_arcade_safe_door', x = -4.33, y = 1.80, z = 3.20, heading = 90.0, label = "Crack", icon = "fa-solid fa-vault"}, -- it spawns randomly
        {type = "item", prop = 'prop_tv_04', x = 2.69, y = -2.09, z = 2.60, heading = 0.0, itemName = "low_end_tv", label = "Grab", icon = "fa-solid fa-user-ninja"},
        {type = "item", prop = 'prop_tv_03', x = -3.54, y = 4.60, z = 2.80, heading = 45.0, itemName = "low_end_tv", label = "Grab", icon = "fa-solid fa-user-ninja"},
        {type = "item", prop = 'ch_prop_ch_wallart_01a', x = -1.14, y = -4.01, z = 3.30, heading = 90.0, itemName = "low_end_art", label = "Grab", icon = "fa-solid fa-user-ninja"},
        {type = "item", prop = 'as_prop_as_speakerdock', x = 3.15, y = 4.93, z = 2.97, heading = 0.0, itemName = "ipod", label = "Grab", icon = "fa-solid fa-user-ninja"},
        {type = "item", prop = 'prop_toaster_02', x = 6.24, y = 2.84, z = 2.97, heading = 0.0, itemName = "toaster", label = "Grab", icon = "fa-solid fa-user-ninja"},
    },
    zones = {
        {x = 6.08, y = -0.02, z = 2.11, heading = -267.99, label = "Search", icon = "fa-solid fa-magnifying-glass"},
        {x = -3.31, y = -1.55, z = 2.10, heading = -179.23, label = "Search", icon = "fa-solid fa-magnifying-glass"},
        {x = 1.23, y = -2.14, z = 2.05, heading = -2.50, label = "Search", icon = "fa-solid fa-magnifying-glass"},
    },
},

4) Go to your server and use the command /robbery:shell, in the dropdown menu choose your new shell (in this example is called Example Shell):

5) You will be spawned inside the shell and a blue marker will appear floating in front of you, this marker is used to retrieve coords, for example, go to the door and place the marker where you want the player to spawn when they enter the house:

6) The heading is taken from your current character heading that's why I'm not facing the door, grab those coords and add them in the door table, like this:

door = {x = 4.99, y = 3.86, z = 0.17, heading = -177.85},

7) Use the command /testobject to spawn the alarm prop and grab the needed coords, like this:

/testobject v_res_tre_alarmbox

8) An alarm prop will be spawned inside the blue marker, rotate it using your left/right arrow keys to be facing the right side:

9) Grab the alarm coords and replace them inside objects ={}, the code should look something like this:

10) Do the same for the safe, use the command:

/testobject ch_prop_ch_arcade_safe_door

11) Grab the coords and replace them for the safe, you can add more items but it depends on your shell, if the shell already have too many objects and you can't place like a TV, art, etc just leave the alarm and safe, for this shell I don't have many room to add a TV or other props but there's a little space where I'm gonna add jewelry. I run the same prop command again but will add a different prop:

/testobject ex_office_swag_jewelwatch3

Right now my code looks like this, I removed the extra objects because this shell doesn't have enough room for a TV or other props:

12) Now lets add the zones where the player can simply press E and get a random item from our Config.ZoneRewards, simply put the marker in the zone and grab the coords, you can add as many zones as you want:

That's it, we have configured our new shell and the final code looks like this:

['Example'] = { -- This is the key index
    label = "Example Shell", -- Label to display in creator menu
    shell = `modernhotel_shell`, -- Shell object name
    z = 25.0, -- How far down should be spawned
    door = {x = 4.91, y = -1.06, z = 3.33, heading = -2.95},
    objects = {
        {type = "alarm", prop = 'v_res_tre_alarmbox', x = 6.52, y = 2.46, z = 1.40, heading = -270.0, label = "Hack", icon = "fa-solid fa-laptop-code"}, -- Alarm don't remove it
        {type = "safe", prop = 'ch_prop_ch_arcade_safe_door', x = -6.50, y = -2.58, z = 1.33, heading = -90.0, label = "Crack", icon = "fa-solid fa-vault"}, -- it spawns randomly
        {type = "jewelry", prop = 'ex_office_swag_jewelwatch3', x = -4.40, y = 4.23, z = 1.12, heading = 0.0, label = "Grab", icon = "fa-solid fa-user-ninja"},
    },
    zones = {
        {x = -4.5, y = -3.97, z = 1.40, heading = -180.50, label = "Search", icon = "fa-solid fa-magnifying-glass"},
        {x = -1.41, y = -3.97, z = 1.40, heading = -180.50, label = "Search", icon = "fa-solid fa-magnifying-glass"},
        {x = 1.40, y = -3.97, z = 1.40, heading = -180.50, label = "Search", icon = "fa-solid fa-magnifying-glass"},
        {x = 4.53, y = -3.97, z = 1.40, heading = -180.50, label = "Search", icon = "fa-solid fa-magnifying-glass"},
    },
},

13) Now press H to exit the Shell and restart the script, run the command /robbery:shell and select the test shell, it will now spawn the objects and zones you created.

Make sure to read the New Houses and Object Types guides :D

Last updated