import{_ as i,c as s,o as a,U as e}from"./chunks/framework.BouBWMxc.js";const g=JSON.parse('{"title":"Rate Limit","description":"","frontmatter":{},"headers":[],"relativePath":"api/1.0/ratelimit.md","filePath":"api/1.0/ratelimit.md"}'),t={name:"api/1.0/ratelimit.md"},n=e(`

Rate Limit

Ratelimit is one of most useful feature.

( Configured on Server and For Client )

Setup

When creating a event on Server, you can add second argument as table rateLimit to limit the number of times the event can be called and the interval for reset the counter.

lua
-- Server
-- Let's make the event have ratelimit with max 50 entrance for 2 seconds.
local Remote = Warp.Server("Remote1", {
	maxEntrance = 50, -- maximum 50 fires.
	interval = 2, -- 2 seconds
})
-- Now the Event RateLimit is configured, and ready to use.
-- No need anything to adds on client side.
lua
-- Client
local Remote = Warp.Client("Remote1")
-- The Event will automatic it self for retreiving the rate limit configuration from the server.
`,6),l=[n];function h(p,r,k,d,o,c){return a(),s("div",null,l)}const m=i(t,[["render",h]]);export{g as __pageData,m as default};