Skip to content

Commit

Permalink
Fix debounce for antiexploit notifications (#1783)
Browse files Browse the repository at this point in the history
* Fix notification debounce not being utilized

The debounce was being set to 1 if the value was set, but other than that, it was not being increased, hence the debounce never kicked in.

* off by one; make it 3 notifications again

* Debounce table gets cleared within 60 seconds, not after
  • Loading branch information
Speeder323 authored Jan 11, 2025
1 parent c6a2884 commit 0cf0aa0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion MainModule/Server/Core/Anti.luau
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ return function(Vargs, GetEnv)

if Settings.AENotifs == true or Settings.ExploitNotifications == true then -- AENotifs for old loaders
local debounceIndex = `{action}{player}{info}`
if os.clock() < antiNotificationResetTick then
if os.clock() > antiNotificationResetTick then
antiNotificationDebounce = {}
antiNotificationResetTick = os.clock() + 60
end
Expand All @@ -201,6 +201,8 @@ return function(Vargs, GetEnv)
return
end

antiNotificationDebounce[debounceIndex] += 1

for _, plr in service.Players:GetPlayers() do
if Admin.GetLevel(plr) >= Settings.Ranks.Moderators.Level then
Functions.Notification("Notification", string.format(
Expand Down

0 comments on commit 0cf0aa0

Please sign in to comment.