AntiRemoteSpam - Styxling/Feather GitHub Wiki
Allows for easy tracking of user pings to RemoteEvents and RemoteFunctions. If a player exceeds a given limit within a short time span, they are kicked from the game.
Every time the 'check' method is run, a counter for the provided player is increased by 1. The counter decreases by 1 for every unit of time (see the .new function) that has passed since the last time they were checked.
AntiRemoteSpam.new(limit : number, timeUnit : number)
-- Creases a new RemoteLimitClass
-- 'limit' is the upper limit that the counter can reach before the user is kicked.
-- 'limit' defaults to 24
-- 'timeUnit' is how much time needs to pass between the previous check for the counter to decrease by 1. EX: if the time between checks is 1.5 seconds and timeUnit is 0.5, the counter will decrease by 1.5/0.5 = 3
-- 'timeUnit' defaults to 0.1
AntiRemoteSpam:check(player : Player) : boolean
-- Increases the counter for the given player by 1 and kicks them if their counter exceeds the limit established in the constructor