> For the complete documentation index, see [llms.txt](https://devmosaic.gitbook.io/devmosaic/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devmosaic.gitbook.io/devmosaic/resources/devmosaic-dm-movement/exports.md).

# Exports

Client exports provided by dm-movement for third-party script integrations.

`dm-movement` provides client-side exports allowing other resources on your server (e.g. death scripts, cuff systems, custom HUDs, or minigames) to query state or toggle movement dynamically.

***

### Client Exports

#### IsTraversing

Checks whether the local player is currently performing a vault, mantle, or climb animation.

```lua
local isTraversing = exports['dm-movement']:IsTraversing()
```

* **Returns**: `boolean` — `true` if the player is actively climbing or vaulting, `false` otherwise.

**Example**

```lua
-- Block inventory opening while climbing
local isClimbing = exports['dm-movement']:IsTraversing()
if isClimbing then
    lib.notify({ title = 'Action Blocked', description = 'You cannot open your bag while climbing!', type = 'error' })
    return
end
```

***

#### GetLean

Returns the current lean blend value of the local player.

```lua
local leanAmount = exports['dm-movement']:GetLean()
```

* **Returns**: `number` — A float value between `-1.0` and `1.0`:
  * `-1.0`: Full lean left.
  * `0.0`: Neutral / not leaning.
  * `1.0`: Full lean right.

**Example**

```lua
-- Check if player is currently leaning
local lean = exports['dm-movement']:GetLean()
if math.abs(lean) > 0.1 then
    print('Player is actively leaning:', lean)
end
```

***

#### IsBarrelBlocked

Checks whether the local player's weapon barrel is currently blocked by cover or a solid obstacle.

```lua
local isBlocked = exports['dm-movement']:IsBarrelBlocked()
```

* **Returns**: `boolean` — `true` if the muzzle is obstructed, `false` if clear to fire.

**Example**

```lua
-- Trigger custom crosshair or warning sound when gun barrel is jammed against a wall
local blocked = exports['dm-movement']:IsBarrelBlocked()
if blocked then
    -- Custom HUD or indicator logic
end
```

***

#### SetEnabled

Enables or disables the entire movement system dynamically on the client. When disabled, any active traversal or lean is immediately cancelled.

```lua
exports['dm-movement']:SetEnabled(state)
```

* **Parameters**:
  * `state`: `boolean` — `true` to enable movement, `false` to disable.

**Example**

```lua
-- Disable movement features while in hospital bed, cuffed, or in a cutscene
RegisterNetEvent('my_cuff:client:cuffPlayer', function(isCuffed)
    exports['dm-movement']:SetEnabled(not isCuffed)
end)
```
