I have the error 'attempt to perform arithmetic (sub) on number and nil. 9th line
local remote = game:GetService("ReplicatedStorage"):WaitForChild('GetCacheData')
local storage = game:GetService("ServerStorage")
local Cache = require(storage:WaitForChild('CacheData'))
local timeout = 5
local logged = {}
remote.OnServerInvoke = function(player, kind, ...)
if not player or not kind then return false end
if tick()-logged[player.UserId] < timeout then return false end
local thisCache = Cache[kind]
if #{...} < 1 then return thisCache end
for _, k in pairs({...}) do
thisCache = thisCache[k] or thisCache
end
logged[player.UserId] = tick()
return thisCache
end

1 comment
logged[player.UserId] shouldn't be nil, try printing to see if it is nil, check if it's nil basically