# Buckets

{% hint style="warning" %}
**SERVER FUNCTIONS**
{% endhint %}

## bucket\_list

Stores bucket definitions for script use.\
If you need the full list for any reason you can access it this way.

```lua
bdtk.bucket_list = {
    main = {
        label = "Main World", -- label for display
        bucket = 0, -- default bucket
        mode = "strict", -- https://docs.fivem.net/natives/?_0xA0F2201F
        population_enabled = false, -- https://docs.fivem.net/natives/?_0xCE51AC2C
        player_cap = false, -- false | number: If number players max players in bucket will be capped at value.
        staff_only = false, -- e.g. { "admin", "mod" }
        vip_only = false, -- e.g. 2 = VIP level 2 required
        spawn = vector4(-268.47, -956.98, 31.22, 208.54), -- spawn point
        respawn = vector4(341.28, -1396.83, 32.51, 48.78) -- respawn point
    }
}
```

***

## get\_bucket

Returns the full bucket config for a given ID.

#### Parameters

* id: `string`

#### Returns

* `table | nil`

```lua
bdtk.get_bucket(id)
```

***

## get\_bucket\_by\_label

Returns the bucket config matching a label.

#### Parameters

* label: `string`

#### Returns

* `table | nil`

```lua
bdtk.get_bucket_by_label(label)
```

***

## get\_bucket\_spawn

Returns the spawn point for a bucket.

#### Parameters

* id: `string`

#### Returns

* `vector4 | nil`

```lua
bdtk.get_bucket_spawn(id)
```

***

## get\_bucket\_respawn

Returns the respawn point for a bucket.

#### Parameters

* id: `string`

#### Returns

* `vector4 | nil`

```lua
bdtk.get_bucket_respawn(id)
```

***

## is\_bucket\_staff\_only

Checks if a bucket is staff-only for a given role.

#### Parameters

* id: `string`
* role: `string`

#### Returns

* `boolean`

```lua
bdtk.is_bucket_staff_only(id, role)
```

***

## is\_bucket\_vip\_only

Checks if a bucket is VIP-only for a given level.

#### Parameters

* id: `string`
* vip\_level: `number`

#### Returns

* `boolean`

```lua
bdtk.is_bucket_vip_only(id, vip_level)
```

***

## apply\_bucket\_settings

Applies population and lockdown mode to all defined buckets.

```lua
bdtk.apply_bucket_settings()
```
