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!