This commit is contained in:
Bl4ise 2024-05-02 11:18:19 +00:00 committed by GitHub
commit a6a504051c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,11 +13,14 @@ function RateLimit.create(Identifier: string, entrance: number?, interval: numbe
Event:SetAttribute(Identifier.."_ent", entrance) Event:SetAttribute(Identifier.."_ent", entrance)
Event:SetAttribute(Identifier.."_int", interval) Event:SetAttribute(Identifier.."_int", interval)
else else
while (not Event:GetAttribute(Identifier.."_ent")) or (not Event:GetAttribute(Identifier.."_int")) do task.spawn(function()
task.wait(0.5) while (not Event:GetAttribute(Identifier.."_ent") and not Event:GetAttribute(Identifier.."_int")) do
end task.wait(0.5)
entrance = tonumber(Event:GetAttribute(Identifier.."_ent")) end
interval = tonumber(Event:GetAttribute(Identifier.."_int"))
entrance = tonumber(Event:GetAttribute(Identifier.."_ent"))
interval = tonumber(Event:GetAttribute(Identifier.."_int"))
end)
end end
local entrances: number = 0 local entrances: number = 0
return function(incoming: number?): boolean return function(incoming: number?): boolean
@ -31,4 +34,4 @@ function RateLimit.create(Identifier: string, entrance: number?, interval: numbe
end end
end end
return RateLimit :: typeof(RateLimit) return RateLimit :: typeof(RateLimit)