> For the complete documentation index, see [llms.txt](https://bluen-store.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bluen-store.gitbook.io/docs/cinema-system/configuration/setting-up-cinema.md).

# Setting up cinema

{% stepper %}
{% step %}

#### Go to config.lua

You can easily configure or add a new cinema to our script by accessing the following directory: `brnx-cinemasystem/modules/shared/config.lua`. This file provides all the necessary options for customization, ensuring a seamless integration tailored to your needs.
{% endstep %}

{% step %}

#### Create cinema

To start creating a new cinema, you need to go to the file `brnx-cinemasystem/modules/config/config.lua`, and after that, follow the instructions below.

{% hint style="danger" %}
If you don't have the [Ten Cent](https://brunxmods.com/product/ten-cent-cinema), [Cinema Doppler](https://brunxmods.com/product/cinema-doppler) or [Drive-In](https://brunxmods.com/product/drive-in-cinema) maps, you will need to configure the entire script manually. However, if you do have these maps, there's no need to worry, as both are already pre-configured. You can still edit them if needed. Follow the examples below to create a new cinema.
{% endhint %}

1. To begin, you need to create an ID to serve as your cinema's identifier, as well as the cinema's name. Follow the example below.

{% code title="brnx-cinemasystem/modules/config/config.lua" fullWidth="true" %}

```lua
config.cinemas = {
    { id = 'newcinema', name = 'New Cinemaa' }
}
```

{% endcode %}

2. It is necessary to configure your cinema screen. You need to get the screen prop’s hash and its replace-texture and set it up exactly like in the example below. If you don’t do this correctly, the movie videos will not work.

{% code title="brnx-cinemasystem/modules/config/config.lua" fullWidth="true" %}

```lua
config.screens = {
    ['newcinema'] = {
        hash = modelHash,
        replace = replaceName
    }
}
```

{% endcode %}

3. After completing all the steps above, you need to create the sessions, meaning the rooms where the movies will play. To do this, PolyZone is required. Check the example below and follow the instruction video.

<pre class="language-lua" data-title="brnx-cinemasystem/modules/config/rooms.lua" data-full-width="true"><code class="lang-lua">Rooms = {
    --[[ EXAMPLE
        ['TEN01'] = PolyZone:Create(
        {
            -- Right 1
            vector2(431.3143, -736.444),
            vector2(431.011, -736.6022),
            vector2(430.8264, -736.9187),

            -- Left 1
            vector2(408.7516, -736.9187),
            vector2(408.6461, -736.6154),
            vector2(408.2769, -736.444),

            -- Left 2
            vector2(408.9758, -691.8198),
            
            -- Right 2
            vector2(430.7473, -691.3318)
        }, 
        {
            debugGrid=config.debug,
            minZ = 0.0,
            maxZ = 28.0,
            data = {}
        }
    ),]]
    ['NEWCINEMA01'] = PolyZone:Create({
            vector2(0.0,0.0),
            vector2(0.0,0.0)
        }, 
        {
            debugGrid=config.debug,
            minZ = 0.0,
            maxZ = 0.0,
            data = {}
        }
    ),
}

<strong>Exits = {
</strong>    ['NEWCINEMA01'] = vector4(0, 0, 0, 0) -- REQUIRED
}

Cinemas = {
    ['NEWCINEMA01'] = 'newcinema'
}
</code></pre>

{% hint style="info" %}
The **Rooms** variable is used to identify the room.

The **Exit** variable is used to determine where the player should go if they are removed from the session.

The **Cinemas** variable is used to identify which cinema this room belongs to.
{% endhint %}

#### How to create a polyzone?

{% embed url="<https://youtu.be/VSxAMPqCh00>" %}

{% code fullWidth="true" %}

```lua
-- Command used in the video
RegisterCommand('vec2', function(source)
    local coords = GetEntityCoords( GetPlayerPed(source) )
    local writeVec2 = tostring( vec2(coords.x,coords.y) )
    print(writeVec2)
end)
```

{% endcode %}

4. Now it is necessary to create the **totems**, so that players can buy movie tickets.

{% code title="brnx-cinemasystem/modules/config/config.lua" fullWidth="true" %}

```lua
config.totems = {
    enabled = true,
    locations = {
        { coords = vector3(0.0, 0.0, 0.0), distance = 1.2, config = 'newcinema' },
    }
}
```

{% endcode %}

5. This isn't mandatory, but you can also add your cinema to the game map.

{% code title="brnx-cinemasystem/modules/config/config.lua" fullWidth="true" %}

```lua
config.blips = {
    { 
        coord = vector3(0.0,0.0,0.0),
        sprite = 135, 
        color = 29, 
        scale = 0.7, 
        name = 'Cinema | New Cinema'
    }
}
```

{% endcode %}

{% hint style="danger" %}
Remember, the movies do not follow the in-game time; they are based on real-life time. To make things easier for players, the tablet where you buy the tickets shows the real-life time. And when you are about to enter a session, it also shows the session times and the current time.
{% endhint %}
{% endstep %}

{% step %}

#### Create films

First, add your license to the tablet's permissions to gain access, or remove the permissions and leave it completely open.

<figure><img src="https://2723880247-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqINoW16Htqw2onHmq7mY%2Fuploads%2FYVX23XcXxi865ZamTzP3%2Fimage.png?alt=media&amp;token=1f69d879-aa29-475f-96a7-4e7207960929" alt=""><figcaption></figcaption></figure>

{% code title="brnx-cinemasystem/modules/server/custom/frameworks/yourframework.lua" fullWidth="true" %}

```lua
-- This way you allow anyone to tamper with the control panel.
canAcessThePanel = function(source)
    return true
end
```

{% endcode %}

{% embed url="<https://youtu.be/t2ldkqnwMTE>" %}

{% hint style="danger" %}
**Note:** The video must be in `.mp4` format. If your movie is in `.mkv`, `.avi`, or any other format, convert it to `.mp4` first. You can do this for free using websites such as CloudConvert.

**Note 2:** The link must point **directly to the video file**, not to the webpage where the video is displayed. An easy way to check if the link is correct is to paste it into your browser. If it opens a black screen with only the video playing, the link is correct. If it opens a website with buttons, comments, logos, menus, etc., the link is wrong and will not work.

Example of a valid link:

```
https://yourwebsite.com/movies/movie.mp4
```

**Note 3:** YouTube, Vimeo, Google Drive, MEGA, Streamable, and Dropbox links **will not work**. There is no point in trying — this is not a limitation of the script. These platforms do not allow the video file to be accessed directly from outside their services.

**Note 4:** So where should you host the video? Use a file hosting service designed for this purpose. The most commonly used options in the FiveM community are:

* **Fivemanage** (fivemanage.com) — the easiest option and made specifically for FiveM
* **Cloudflare R2** (dash.cloudflare.com) — inexpensive and can handle a large number of users
* **Bunny.net** paid, but very fast

Upload your `.mp4` file to one of these services. It will provide you with a direct link, and that is the link you should paste into the config.

**Note 5:** The link must start with `https://`. If it starts with `http://` without the "s", the movie will not load.

**Note 6:** You can place the `.mp4` file directly inside the script folder, but **we do not recommend it**. A movie can be hundreds of MB in size, which means every player joining your server will have to download the entire file before they can play. This will result in extremely long loading times and may cause the script to take much longer to start. Always prefer hosting the video using one of the services listed above.

**Note 7:** In the `minutes` field, enter the movie's actual duration in minutes. For example, if the movie is 1 hour and 25 minutes long, enter `85`. The script uses this number to calculate when the session should end. If the value is incorrect, the room may close before the movie finishes or remain open after the movie has already ended.

**Having issues? Check below:**

* **The screen goes dark and displays "Could not load the film"** → The link is incorrect, or the hosting provider does not allow the video to be accessed externally. Test the link in your browser first (see Note 2). If it works normally in the browser but still does not work in-game, try a different hosting provider.
* **The movie always starts from the beginning for players who join late, even though the session has already started** → The hosting provider you are using does not support the functionality required to synchronize the movie properly. Switch to one of the hosting services listed in Note 4.
* **The video keeps freezing or buffering** → The hosting provider may be too slow, or the video file may be too large. Reduce the video's quality/file size or switch to a different hosting provider.
  {% endhint %}

{% hint style="danger" %}
When setting the times in the room, you need to place **commas between each time**.\
Example: **12:00, 13:00**.\
The comma can be attached to the number or separated, but there must always be a comma between the times.
{% endhint %}

{% hint style="warning" %}
The time must be in 24-hour format.\
So check the times on this website to convert 12-hour time into 24-hour time: [**https://www.lsoft.com/resources/24hours.asp**](https://www.lsoft.com/resources/24hours.asp)
{% endhint %}
{% endstep %}
{% endstepper %}
