> For the complete documentation index, see [llms.txt](https://xtdev.gitbook.io/xt-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xtdev.gitbook.io/xt-docs/free-resources/cooldowns/installation-and-usage.md).

# Installation & Usage

## Installation:

* Install the provided sql file `cooldowns.sql`
* Setup the server config found in `configs > server.lua`

## Usage:

Callbacks are used to check if a cooldown is active, and to enable a cooldown.

The `cooldowns:isActive` callback checks if the global cooldown is active before checking if the specific cooldown is active.

```lua
-- Check if cooldown is active
local isActive = lib.callback.await('cooldowns:isActive', false, cooldownName)

-- Enables cooldown
local toggle = lib.callback.await('cooldowns:enable', false, cooldownName)
```
