# How to add MLO House

## How to

### Creating the MLO:

Locate your **Config.Houses** inside main\_config.lua file:

<figure><img src="https://3317815405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAcw6nAW8IGe15skCfMoj%2Fuploads%2FhhfrrHgC3UnEgamIJMSE%2Fimage.png?alt=media&#x26;token=fa73f1eb-b4c3-4484-a048-c2ab9171604c" alt=""><figcaption><p>Config file showing Config.Houses</p></figcaption></figure>

As you can see, thats all your houses created **VIA CONFIG FILE.**

{% hint style="warning" %}
You should leave config file to create new MLO houses and in game real estate job for normal houses and apartments.
{% endhint %}

On left side of this boxes we present the template, on right one we present the example.

{% tabs %}
{% tab title="Template" %}

```lua
["house_name"] = { -- House name, MUST BE UNIQUE OTHER WISE WILL HAVE ERRORS
        houseName = "house_name", -- House name, MUST BE UNIQUE OTHER WISE WILL HAVE ERRORS
        price = 25000, -- House price
        maxFurnitureRange = 45, -- max range to be able to furniture
        doorCoords = vector4(), -- House door coords
        doorInside = Config.Tiers["mloFranklin"], -- House inside infos
        houseGarage = {
            enabled = true, -- House garage enabled ?
            coords = vector3(), -- House garage door entrance
            doorInside = Config.Tiers["modGarage"], -- House garage inside infos
            storeCar = vector3(), -- House garage car storage
            spawnCar = vector4(), -- House garage car spawn
        },
        stars = 5, -- House rating
        pool = true, -- House have a pool?
        garden = true, -- House have a garden?
        camerasystem = true, -- House have a camera?
        canVisit = false, -- House can be visited?
        stashLevel = 1, -- What level is default level of stash?
        stashName = "", -- Stash name, must be unique, if same name houses can share their stash
        mlo = true, -- LEAVE ALWAYS TRUE IF YOU ARE CREATING A MLO House
        description = "" -- House description
    },
```

{% endtab %}

{% tab title="Example" %}

```lua
["myFirstMLOHouse"] = { -- House name, MUST BE UNIQUE OTHER WISE WILL HAVE ERRORS
        houseName = "myFirstMLOHouse", -- House name, MUST BE UNIQUE OTHER WISE WILL HAVE ERRORS
        price = 125000, -- House price
        maxFurnitureRange = 45,
        doorCoords = vector4(8.37, 539.73, 176.03, 341.19), -- House door coords
        doorInside = Config.Tiers["mloFranklin"], -- House inside infos
        houseGarage = {
            enabled = true, -- House garage enabled ?
            coords = vector3(25.02, 541.02, 176.03), -- House garage door
            doorInside = Config.Tiers["modGarage"], -- House garage inside infos
            storeCar = vector3(22.56, 544.11, 176.03), -- House garage car storage
            spawnCar = vector4(14.44, 549.54, 176.3, 49.25), -- House garage car spawn
        },
        stars = 5, -- House rating
        pool = true, -- House have a pool?
        garden = true, -- House have a garden?
        camerasystem = true, -- House have a camera?
        canVisit = false, -- House can be visited?
        stashLevel = 1, -- What level is default level of stash?
        stashName = "mloTestingHouse2", -- Stash name, must be unique, if same name houses can share their stash
        mlo = true, -- is it a MLO?
        description = "Modern House with pool, garen, camara system and visiting options! Cheap!" -- House description
    },
```

{% endtab %}
{% endtabs %}

The first **\[""]**, you should write the same you will put as **houseName** inside the **""**, it needs to be <mark style="color:red;">**UNIQUE**</mark>, cant repeat it **NEVER**! (Check Example to understand better what we want to explain).

**maxFurnitureRange** is the range players will be able to put new furniture inside their house, this is great to adjust to perfection the zone, because MLOs can be big or small right?\
( You can change this anytime so you can keep testing it )

**doorCoords** is the coords you will use to join, in this case will be the coords or main door of house, to provide infos to script work as intended.

**doorInside** is where you will setup all markers inside and their coords, the animations, the stash, the wardrobe, management zone and logout.

{% hint style="info" %}
**How i add a new interior infos?**\
\
This part is very important, it allows you to add new MLOs informations.\
Navigate to **Config.Tiers** on config file, should be something like this:
{% endhint %}

<figure><img src="https://3317815405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAcw6nAW8IGe15skCfMoj%2Fuploads%2FkQuGgaz3fSzRz9eDJGG5%2Fimage.png?alt=media&#x26;token=1e01373a-0730-40d5-a54c-4b5ecdadebec" alt=""><figcaption><p>Config file showing Config.Tiers</p></figcaption></figure>

As you can see, there you have **ALL** interiors informations of **JPR Housing System**, the next board, on left side will be the template, on right the example.

{% tabs %}
{% tab title="Template" %}

```lua
["MLO_NAME"] = {
        doorCoords = vector4(), -- see cameras interaction zone
        defaultStash = vector3(), -- default stash interaction zone
        defaultWardrobe = vector3(), -- default wardrobe interaction zone
        defaultLogout = vector3(), -- default logout interaction zone
        managementCoords = vector3(), -- default management interaction zone
        fridge = {coords = vector4(), fridgeItems = {interactions = {"beer", "soda", "champagne"}, interactionsCommands = {"e beer", "e soda", "e champagne"}}, label = "frigorifico"}, -- default fridge animations zone
        previewImage = nil, -- can leave nil ONLY ON MLOs
        isMLO = true, -- NEVER CHANGE THIS if you are creating a new MLO
    },
```

{% endtab %}

{% tab title="Example" %}

```lua
["mloFranklin"] = {
        doorCoords = vector4(7.76, 538.74, 176.03, 148.44),
        defaultStash = vector3(0.21, 526.72, 170.62),
        defaultWardrobe = vector3(9.4, 528.69, 170.63),
        defaultLogout = vector3(9.74, 530.42, 174.64),
        managementCoords = vector3(6.7, 538.13, 176.03),
        fridge = {coords = vector4(-11.85, 516.66, 174.63, 62.47), fridgeItems = {interactions = {"beer", "soda", "champagne"}, interactionsCommands = {"e beer", "e soda", "e champagne"}}, label = "frigorifico"},
        previewImage = nil,
        isMLO = true,
    },
```

{% endtab %}
{% endtabs %}

Now, on houseGarage is a very easy part:

```lua
houseGarage = {
  enabled = true, -- if you want MLO to have garage system, then set TRUE if not set FALSE
  coords = vector3(-815.35, 183.06, 72.43), -- House garage door entrance coords
  doorInside = Config.Tiers["modGarage"], -- House garage inside infos
  storeCar = vector3(-812.13, 187.36, 72.47), -- House garage car storage coords
  spawnCar = vector4(-811.69, 187.62, 72.48, 117.85), -- House garage car spawn coords
},
```

By default, we have 6 garages interiors (**doorInside**), they are:\
**neonGarage**, **highGarage**, **midGarage**, **lowGarage**, **importGarage**, **modGarage**\
\
**Example,** if you want **highGarage** then your **doorInside** of garage  shoud look like this:

```lua
doorInside = Config.Tiers["highGarage"],
```

\
\
The rest of options are pretty easy and obvioslly, they are already explained on template on grey letters.

{% hint style="info" %}
Congratulations, your first MLO house is created, now lets do the doords
{% endhint %}

{% hint style="danger" %}
If you dont want to lock your MLO doors via keyholders with doors, ignore this part.
{% endhint %}

<br>

### Creating MLO doords:

Open **mlo\_doors\_config.lua** file and locate **MLOConfig.MLOHouseDoors:**

<figure><img src="https://3317815405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAcw6nAW8IGe15skCfMoj%2Fuploads%2F4UC0wUp0V0I1FqtF4D7o%2FCaptura%20de%20ecr%C3%A3%202024-06-20%20002647.png?alt=media&#x26;token=f37fa99f-6277-4769-87d8-81e8210e0a64" alt=""><figcaption><p>MLO Doords Config file showing MLOHouseDoords</p></figcaption></figure>

As you can see, it already **includes** some doors from **Michael** default **MLO**.\
The working of this system is **similar** to **qb-doorlock** to be easier to our customers creating new doors.\
\
On next box, **left** side is **template**, **right** one is **example**:

{% tabs %}
{% tab title="Template" %}
For single doords:

```lua
{
    houseName = "house_name_of_mlo", -- the name of MLO house this door is
    propName = "name_of_prop", -- the name of prop you want to lock
    propCoords = vector3(), -- the coords of prop you want to lock
    propTextCoords = vector3(), -- can be save as above, is the emojis coords
    doorType = nil,
    locked = true, -- it will start locked? if yes set to true otherwise to false
    distance = 4 --- distance to interact with door, 4 is recommended
 },
```

\
For double doords:

```lua
{
   houseName = "house_name_of_mlo", -- the name of MLO house this door is
   propTextCoords = vector3(), -- is the emojis coords
   locked = true, -- it will start locked? if yes set to true otherwise to false
   distance = 2.0, --- distance to interact with door, 4 is recommended
   doors = {
       {
   	  propName = 'name_of_prop', -- the name of prop you want to lock
   	  propYam = 291.0, -- heading, not too important, sometimes can let the default
   	  propCoords = vector3() -- the coords of prop you want to lock
       },
   
       {
          propName = 'name_of_prop', -- the name of prop you want to lock
          propYam = 291.0, -- heading, not too important, sometimes can let the default
          propCoords = vector3() -- the coords of prop you want to lock
       }
    }
},
```

{% endtab %}

{% tab title="Example" %}
For single doords:

```lua
{
    houseName = "myFirstMLOHouse", -- the name of MLO house this door is
    propName = "prop_ld_garaged_01", -- the name of prop you want to lock
    propCoords = vector3(-814.48, 186.28, 74.51), -- the coords of prop you want to lock
    propTextCoords = vector3(-815.44, 185.44, 72.48), -- can be save as above, is the emojis coords
    locked = true, -- it will start locked? if yes set to true otherwise to false
    distance = 4 --- distance to interact with door, 4 is recommended
 },
```

\
For double doords:

```lua
{
   houseName = "myFirstMLOHouse", -- the name of MLO house this door is
   propTextCoords = vector3(), -- is the emojis coords
   locked = true, -- it will start locked? if yes set to true otherwise to false
   distance = 2.0, --- distance to interact with door, 4 is recommended
   doors = {
       {
   	  propName = 'v_ilev_mm_doorm_l', -- the name of prop you want to lock
   	  propYam = 291.0, -- heading, not too important, sometimes can let the default
   	  propCoords = vector3(-816.72, 179.1, 72.83) -- the coords of prop you want to lock
       },
   
       {
          propName = 'v_ilev_mm_doorm_r', -- the name of prop you want to lock
          propYam = 291.0, -- heading, not too important, sometimes can let the default
          propCoords = vector3(-816.11, 177.51, 72.83) -- the coords of prop you want to lock
       }
    }
},
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
If you want to use **door hash**, replace **propName** to **propHash**.
{% endhint %}

{% hint style="info" %}
**Compatible door types:**

double

doublesliding

door

garage

sliding
{% endhint %}

{% hint style="danger" %}
For **propHash** doors, the **propYam** needs to be setup ( prop heading when its closed ), this quick video shows how to get it.
{% endhint %}

{% embed url="<https://www.youtube.com/watch?v=ZyrfivptyMU>" %}
Just need to get **HEADING** coords of your door when it is **closed**!
{% endembed %}

{% hint style="success" %}
Congratulations, your **doords** are **created** and **linked** with your new **MLO** house.

\
**How they are linked?**

The anwser is pretty easy, as you know when you created the MLO on **Config.Houses**, you gave a unique houseName to your MLO right?

Then here on door creating, you have put on houseName the same name as before, that way the MLO is linked with this doords, in this case is **myFirstMLOHouse**.
{% endhint %}

## Create MLO House video:

{% embed url="<https://drive.google.com/file/d/1DpriuNXtsvin4U5FjlG2ng19VrIsd77u/view?usp=sharing>" %}
