> For the complete documentation index, see [llms.txt](https://batscripts.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://batscripts.gitbook.io/docs/utility-scripts/bat_bucketmanager/exports/manager-exports.md).

# Manager Exports

You can easily perform bucket actions from your own code by using the server-side exports below.

## GetTime

Returns the current time in the bucket, if it was initialized with Bucket Manager.

```lua
exports["bat_bucketmanager"]:GetTime(bucketId)
-- Returns:
{ hours --[[number]], minutes --[[number]] }
```

* **bucketId**: `number` (required)

This export is also available on the **client-side** as such:

```lua
exports["bat_bucketmanager"]:GetTime()
-- Returns:
{ hours --[[number]], minutes --[[number]] }
```

***

## SetTime

Changes the current time (hours and minutes) in the bucket.

<pre class="language-lua"><code class="lang-lua"><strong>exports["bat_bucketmanager"]:SetTime(bucketId, hours, minutes)
</strong></code></pre>

* **bucketId**: `number` (required)
* **hours**: `number` (optional / defaults to `0`)
* **minutes**: `number` (optional / defaults to `0`)

***

## SetFreezeTime

Freezes/unfreezes the time increment in the bucket.

<pre class="language-lua"><code class="lang-lua"><strong>exports["bat_bucketmanager"]:SetFreezeTime(bucketId, freeze)
</strong></code></pre>

* **bucketId**: `number` (required)
* **freeze**: `boolean` (optional / defaults to `false`)

***

## SetWeather

Changes the weather in the bucket.

<pre class="language-lua"><code class="lang-lua"><strong>exports["bat_bucketmanager"]:SetWeather(bucketId, weatherType, rainLevel)
</strong></code></pre>

* **bucketId**: `number` (required)
* **weatherType**: `string` (required)
  * Check the [FiveM documentation](https://docs.fivem.net/natives/?_0x29B487C359E19889) for the list of all available options.
* **rainLevel**: `number` (optional / defaults to `-1`)
  * `-1` means rain level will change according to the weather.
  * `0` means no rain at all.

***

## SetBlackout

Enables/disables the artificial lights in the bucket.

<pre class="language-lua"><code class="lang-lua"><strong>exports["bat_bucketmanager"]:SetBlackout(bucketId, blackout, blackoutVehicles)
</strong></code></pre>

* **bucketId**: `number` (required)
* **blackout**: `boolean` (optional / defaults to `false`)
* **blackoutVehicles**: `boolean` (optional / defaults to `false`)
