# General Exports

This page explains the available exports for the **r\_scba** script and how to use them. These client-side exports allow you to interact programmatically with the SCBA system from other resources.

***

### 1. Exports Overview

#### **1.1 Toggle SCBA**

```lua
exports['r_scba']:ToggleSCBA()
```

**Description:**\
Toggles the SCBA system on or off. This includes equipping or removing the oxygen mask, managing pressure, and applying visual and audio effects.

***

#### **1.2 Set SCBA Pressure**

```lua
exports['r_scba']:SetSCBAPressure(pressure)
```

**Description:**\
Sets a custom pressure value to the SCBA system.

**Parameters:**

* `pressure`: The pressure value you want to set.

***

#### **1.3 Set Player Coughing State**

```lua
exports['r_scba']:SetPlayerCough(bool)
```

**Description:**\
Allows you to enable or disable the coughing effect on a player.

**Parameters:**

* `bool`: Set to `true` to bypass coughing (e.g., during noclip), `false` to re-enable.

***

#### **1.4 Check if SCBA is Linked**

```lua
exports['r_scba']:IsSCBA()
```

**Description:**\
Returns whether the SCBA is currently linked and active.

**Returns:**

* `true`: If the SCBA is linked (mask equipped).
* `false`: If the SCBA is not active.

***

#### **1.5 Get Current SCBA Pressure**

```lua
exports['r_scba']:GetSCBAPressure()
```

**Description:**\
Returns the current pressure value of the SCBA.

**Returns:**

* The current SCBA pressure level.

***

#### **1.6 Check if Player is Coughing**

```lua
exports['r_scba']:IsPlayerCough()
```

**Description:**\
Checks if the player is currently coughing due to exposure (and other required conditions).

**Returns:**

* `true`: If the player is affected by coughing.
* `false`: Otherwise.

***

### 2. Example Usage

Here is a basic example of how to use the SCBA exports:

```lua
-- Toggle the SCBA system (equip or remove mask)
exports['r_scba']:ToggleSCBA()

-- Set SCBA pressure to 300
exports['r_scba']:SetSCBAPressure(300)

-- Disable coughing temporarily
exports['r_scba']:SetPlayerCough(true)

-- Check if SCBA is linked
if exports['r_scba']:IsSCBA() then
    print("SCBA is active")
end

-- Get current pressure
local currentPressure = exports['r_scba']:GetSCBAPressure()
print("Current SCBA pressure: " .. currentPressure)

-- Check if player is coughing
if exports['r_scba']:IsPlayerCough() then
    print("You are coughing due to smoke!")
end
```
