RateManager
RateManager - The Cooldown / Rate Limit Utility You’ve Been Waiting For
What is RateManager?
RateManager is a new open source module that handles cooldowns and rate limiting cleanly in Roblox Lua.
It’s built to solve one of the most common problems:
“How do I stop players from spamming this button / remote / action?”
And it does that with class
Features
Supports Debounce mode
Supports RateLimit mode (rolling window, e.g. 10 requests per 60 seconds)
Optional queued calls (for clean input batching)
Pause / Resume timer support
:Reset()
, :Cancel()
methods with full control
Signal-based:
OnReset
, OnLimitHit
MIT licensed — free to use, fork, remix, whatever
Installation
Option A – Manual (Studio)
- Get
RateManager
from the creator store - Drop it into
ReplicatedStorage
or wherever you keep modules - Require it like:
local RateManager = require(ReplicatedStorage.Packages.RateManager)
Option B – Rojo / Wally
More info on how to download using rojo/wally is available on the GitHub README file: https://github.com/krazeems/RateManager/blob/main/README.md
Example Usage
Debounce (Classic cooldown)
local cooldown = RateManager.new(2) -- 2 sec cooldown
button.MouseButton1Click:Connect(function()
cooldown:Execute(function()
print("Clicked!") -- Only fires once every 2 seconds no matter how fast they click.
end)
end)
RateLimit (e.g. 5 calls per 10 seconds)
local limiter = RateManager.new(5, 10, RateManager.Mode.RateLimit)
RunService.Heartbeat:Connect(function()
limiter:Execute(function()
print("This runs up to 5 times per 10 seconds")
end)
end)
Queueing (Don’t drop excess calls)
limiter:SetQueueEnabled(true) -- only supported with RateLimit mode
Pause + Resume
limiter:Pause() -- Halts cooldown or rate limit logic temporarily, good for cutscenes, disconnections, etc.
wait(5)
limiter:Resume()
Reset vs Cancel
cooldown:Reset() -- resets timer + will fire onReset
cooldown:Cancel() -- onReset does not get fired for Cancel + resets timer
-- Optional: Pass true to clear any queued calls (RateLimit mode only)
cooldown:Reset(true)
cooldown:Cancel(true)
Events
cooldown.OnReset:Connect(function()
print("Cooldown/Ratelimit reset!")
end)
cooldown.OnLimitHit:Connect(function()
print("Call was blocked due to cooldown/rate limit")
end)
Get the module here: https://create.roblox.com/store/asset/110870034905030/RateManager
Or download with rojo/wally: More info on rojo/wally installation on GitHub README file
Note: this is my first community resource, so please lmk if I did something, Contributions and suggestions are always welcome!