# CooldownService

## How do I use it?

You don't have to do anything to start using CooldownService. It's bundled in the update that is currently rolling out. The default settings are as follows:\
`Timer: 5 seconds, AutoKick: false, LimitCount: 10`

`Timer` indicates how long players have to wait in between sending new requests to the server. With a value of 5, a player can only check someone in or out every 5 seconds.\
`LimitCount` indicates how many requests a player can send during one `Timer` before they are flagged as malicious.\
`AutoKick` indicates whether a player should be KICKED from the game in the event they try to call a request more than `LimitCount` times, within the `Timer` time.\
Example: If you send more than 10 requests in the 5 second timer period, you get kicked.

Finally, we have a new API function to go along with this update: [`API.Service.ExceededLimit`](/api-functions.md#exceededlimit) This event will fire when a player exceeds the configured limit. You can use this function to alert staff, auto ban or anything you want.

## **How to configure CooldownService**

CooldownService is an add-on scripted in the same way as CheckMeIn 4.0, this means it is not compatible with the 3.1 configuration module. You will have to change the configuration through a CheckMeIn Plugin.

1\. Create a [**ModuleScript** ](https://developer.roblox.com/en-us/api-reference/class/ModuleScript)under the Workspace.CheckMeIn.Plugins folder.\
2\. Paste the following code:

```lua
--[[
Cooldown Configuration
CMI 3.1
Written by wind_o
--]]

local Timer = 5
local LimitCount = 10
local AutoKick = false

--Debug Option--
local Echo = false


-- Do not edit below --

return{
['Enabled'] = true; -- Is this plugin enabled?
['Function'] = function(API)
	API.Service.ModifyCooldownService:Fire('Timer', Timer);
	API.Service.ModifyCooldownService:Fire('LimitCount', LimitCount);
	API.Service.ModifyCooldownService:Fire('AutoKick', AutoKick);
	API.Service.ModifyCooldownService:Fire('Echo', Echo);
end}
```

3\. Modify the Timer, LimitCount and AutoKick options to your liking.


---

# 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://api.checkmein.cloud/tutorials/cooldownservice.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.
