# Cooldowns

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

## add\_cooldown

Adds a cooldown for a player or globally.

#### Parameters

* source: `number`
* cooldown\_type: `string`
* duration: `number`
* is\_global: `boolean`

```lua
bdtk.add_cooldown(source, cooldown_type, duration, is_global)
```

***

## check\_cooldown

Checks if a cooldown is active.

#### Parameters

* source: `number`
* cooldown\_type: `string`
* is\_global: `boolean`

#### Returns

* `boolean`

```lua
bdtk.check_cooldown(source, cooldown_type, is_global)
```

***

## clear\_cooldown

Clears a specific cooldown.

#### Parameters

* source: `number`
* cooldown\_type: `string`
* is\_global: `boolean`

```lua
bdtk.clear_cooldown(source, cooldown_type, is_global)
```

***

## clear\_expired\_cooldowns

Clears all expired cooldowns.

```lua
bdtk.clear_expired_cooldowns()
```

***

## clear\_resource\_cooldowns

Clears all cooldowns for a given resource.

#### Parameters

* resource: `string`

```lua
bdtk.clear_resource_cooldowns(resource)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.boii.dev/fivem-free-resources/bdtk/api/modules/cooldowns.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
