Skip to content

Easily manage and limit client-to-server requests in Roblox

Notifications You must be signed in to change notification settings

PogoDigitalism/Request-Limiter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 

Repository files navigation

RequestLimiter

Route your client to server communications through this request-limit manager. Allows you to connect 'cap reached' signals (Requires :Fire method) and enable player kicks when reaching the cap threshold numerous times.

Example:

local rs = game:GetService('ReplicatedStorage')
local sss = game:GetService('ServerScriptService')

local RequestLimiter = require(sss:WaitForChild('RequestLimiter'))

local request_limiter = RequestLimiter.new()
request_limiter:capReachedSignal(SignalService.RemoteCalls__Capped)
request_limiter:enableKick(4)

local remote_funcs = {}
for i, rm: RemoteFunction in rs:WaitForChild('RemoteEvents').PlayerData.FromClient:GetChildren() do
	remote_funcs[rm.Name] = rm
end

local funcs_callbacks = {
	GetEquippedGear = function(p: Player)
		return request_limiter:Route(p, function()
			local player_data = PlayerDataService.GetPlayerDataInstance(p)
			return player_data:EquippedGears()	
		end)
	end,

for k, v in pairs(remote_funcs) do
	v.OnServerInvoke = funcs_callbacks[k]
end

Result: image

About

Easily manage and limit client-to-server requests in Roblox

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages