I am creating a remote function that returns a value to the client. The issue is that I don't know how to debounce on the server so that the requests don't get spammed. Here is what I have tried so far, but the table would get infinitely large:
local playerDebounceList = {}
-- getData is a remote function I define earlier in the script
getData.OnServerInvoke = function(player, input)
local specialKey = tostring(player.UserId)
if not playerDebounceList[specialKey] and tick() - playerDebounceList[specialKey] >= 5 then
playerDebounceList[specialKey] = tick()
return input
end
end
I am really uncertain as to how I would do this without creating a massive table. Thanks!

7 comments
Removing players from the table on the PlayerRemoving event would not be ideal, but it is a possibility if all other routes fail.
what is input?
A string that I will evaluate on the server after I get this debounce working. Don't worry, I am not giving any power to the client.
Solved by _@ and Link149 on the discord.
Both suggested using Delay.
Why was this downvoted?
@Phelegethon with that credit awesome