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()
while (not Event:GetAttribute(Identifier.."_ent") and not Event:GetAttribute(Identifier.."_int")) do
task.wait(0.5) task.wait(0.5)
end end
entrance = tonumber(Event:GetAttribute(Identifier.."_ent")) entrance = tonumber(Event:GetAttribute(Identifier.."_ent"))
interval = tonumber(Event:GetAttribute(Identifier.."_int")) 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