> For the complete documentation index, see [llms.txt](https://laot7490.gitbook.io/ltbridge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://laot7490.gitbook.io/ltbridge/scripting/cooldown.md).

# Cooldown

## Cooldown

Simple rate-limiting for actions — prevent spam clicking, ability reuse, etc.

### Functions

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Check</strong></td><td>Check if a specific cooldown is active.</td><td><a href="#check">#check</a></td></tr><tr><td><strong>Clear</strong></td><td>Clear a specific cooldown early.</td><td><a href="#clear">#clear</a></td></tr><tr><td><strong>Remaining</strong></td><td>Get remaining cooldown time in milliseconds.</td><td><a href="#remaining">#remaining</a></td></tr><tr><td><strong>Start</strong></td><td>Start a cooldown for a specific identifier and key.</td><td><a href="#start">#start</a></td></tr></tbody></table>

***

## Check

Check if a specific cooldown is active.

{% hint style="info" %}
**Side:** Server · **Category:** Cooldown · **API:** `LT.Cooldown.Check`
{% endhint %}

### Example

```lua
local citizenId = LT.Framework.GetPlayerCitizenId(source)
if LT.Cooldown.Check(citizenId, 'gather') then return end
```

### Parameters

| Name         | Required | Description         |
| ------------ | -------- | ------------------- |
| `identifier` | Yes      | string              |
| `key`        | Yes      | Cooldown identifier |

### Returns

* `boolean`

***

## Clear

Clear a specific cooldown early.

{% hint style="info" %}
**Side:** Server · **Category:** Cooldown · **API:** `LT.Cooldown.Clear`
{% endhint %}

### Example

```lua
local result = LT.Cooldown.Clear(1, 'key')
```

### Parameters

| Name         | Required | Description         |
| ------------ | -------- | ------------------- |
| `identifier` | Yes      | string              |
| `key`        | Yes      | Cooldown identifier |

***

## Remaining

Get remaining cooldown time in milliseconds.

{% hint style="info" %}
**Side:** Server · **Category:** Cooldown · **API:** `LT.Cooldown.Remaining`
{% endhint %}

### Example

```lua
local result = LT.Cooldown.Remaining(1, 'key')
```

### Parameters

| Name         | Required | Description         |
| ------------ | -------- | ------------------- |
| `identifier` | Yes      | string              |
| `key`        | Yes      | Cooldown identifier |

### Returns

* `number remainingMs`

***

## Start

Start a cooldown for a specific identifier and key.

{% hint style="info" %}
**Side:** Server · **Category:** Cooldown · **API:** `LT.Cooldown.Start`
{% endhint %}

### Example

```lua
local citizenId = LT.Framework.GetPlayerCitizenId(source)
LT.Cooldown.Start(citizenId, 'gather', 5000) -- 5 seconds
```

### Parameters

| Name         | Required | Description                       |
| ------------ | -------- | --------------------------------- |
| `identifier` | Yes      | string                            |
| `key`        | Yes      | Cooldown identifier               |
| `duration`   | Yes      | Cooldown duration in milliseconds |
