> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaksam-scripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set door ID state (locked/unlocked)

> Verrouille ou déverrouille une porte côté serveur par son ID.

```lua Export theme={null}
exports["doors_creator"]:setDoorState(doorId, state)
```

### Paramètres

| Nom | Type de donnée | Description |
| - | - | - |
| `doorId` | integer | L'ID de la porte |
| `state` | integer | Le nouvel état de la porte. 1 = verrouillé, 0 = déverrouillé |

## Exemple

```lua theme={null}
Citizen.CreateThread(function()
    local doors = exports["doors_creator"]:getAllDoors()

    -- This will close ALL the doors
    for k, doorData in pairs(doors) do
        exports["doors_creator"]:setDoorState(doorData.id, 1)
    end
end)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.