# Bifold Doors

This resource is installed like any other resource. See our [Installing Resources](/tebex-fivem-escrow-system/installing-resources.md)page for help here.&#x20;

This resource requires configuration, and a model of a quarter of the bifolding door, to work. If you have been directed here by another shop then they will likely have provided the model to you already, and perhaps even the configuration files.

## Configuration

The resource controls 1 bifolding door at a time, so to have multiple bifolding doors you should run multiple versions of the resource at the same time.

**The configuration file**

`Config.password` toggles whether the door requires a password for the command to open the door

`Config.passcode` defines the password to use if you wish to use a password and password is enabled.

`Config.UniqueIdentifier` should be used where you are using multiple bifolding doors, so you are using multiple copies of the script running at once. This must be unique to each resource, for example the first copy could be "Bifold1" and the second could be "Bifold2".

`Config.DoorModel` is the spawn code for the quarter segment of the bifolding door that the script will spawn 4 times to make all 4 parts of the door.

`Config.DoorCommand` is the command that is used to open the door. This must be unique to each copy of the resource, similar to the UniqueIdentifier.

`Config.DoorModelWidth` is the width of the door segment model. This can be found in your modelling program if you made the door, or the shop that provided the model to you should provide this value if they do not provide the config file.

`Config.DoorHeading` this is the direction that the door faces.

`Config.DoorXPosition` is the X coordinate for the far left hand side of the door.

`Config.DoorYPosition` is the Y coordinate for the far left hand side of the door.

`Config.DoorZPosition` is the Z coordinate of the far left hand side of the door.

`Config.DoorZOffsetPosition` sometimes when the door opens, it moves up when it starts opening. Use this number to offset the door when the door starts opening. Typical values are between 0.0 and 8.0.

`Config.DoorSpeed` is the speed at which the door opens. This value is the mathematical degree that the angle of the doors increases/decreases by every frame.

`Config.DoorOpenTime` this is the amount of miliseconds that the door holds open for, before beginning to close.

`Config.DoorOpenPrompt` this is the text that shows in the top left of you screen when you are near a control panel.

`Config.DoorOpenKey` this is the control ID that you use to open the door when near a control panel. A list of all control IDs can be found here: <https://docs.fivem.net/docs/game-references/controls/>

```lua
Config.ControlPanels = {
    {["x"] = -747.16, ["y"] = -1511.34, ["z"] = 4.88, ["dist"] = 3.0}, -- the XYZ coordinates and distance you have to be within for control panels to open the door
    {["x"] = -739.11, ["y"] = -1502.55, ["z"] = 5.0, ["dist"] = 3.0}. -- an example of a second entry
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bradleyking.xyz/paid-resources/bifold-doors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
