Kronix is a Module that can help you secure your remotes by preventing spamming. Basically, if an exploiter fires a remote really fast, they will be punished.
Configurations:
- max → how many times the remote can be fired within given [duration]
- duration → if the remote is fired [max] times in [duration] seconds, it will return false (means remote was spammed)
- accurate → decreases duration by 1/4 seconds, allowing the remote to be fired [max]+1 times in given duration
- kick → kick player if they spammed
- debug → enables debug
Please refrain from using Kronix on constantly fired remotes (from fast loops).
Source, Place example (Source in ServerScriptService.Script):
Kronix.rbxl (360.3 KB)
How to use?
local Remote = RepStorage:WaitForChild('RemoteEvent'); --// the remote
local Kronix = require(6451897328); --// the module
Remote.OnServerEvent:Connect(function(plr)
local check = Kronix.security({
player = plr; -- player object
remote = Remote; -- remote instance
-- duration = time (seconds) // default: 1, how much time it takes to reset the fires
-- max = amount (number) // default: 3, if player fired remote x times too fast, it will return false
-- accurate = boolean // default: false, decreases duration by 1/4 seconds
-- kick = boolean // default: false, kicks player if they spam remote and throws an error to cancel the script execution
-- debug = boolean // default: false, enables debug for current remote, if script errors because it misses player/remote, it will throw a fake error and return true
});
--[[
check is always a boolean
if check is false, it means player spammed remote
if check is true, it means player didn't spam remote
]]
if not check then
return plr:Kick('Remote Fired too fast!'); --// custom kick message, can be anything you want, here you punish players for spamming the remote
end;
--// rest of your script
plr.leaderstats.Clicks.Value += 1;
end);
If you need help with anything, please don’t hesistate to ask.
Anything you wish me to add or change, please let me know.