Any potential problems or improvements?
local counts = {}
local function returnInventory(player)
if counts[player] then
counts[player] = (counts[player] + 1)
else
counts[player] = 1
end
if counts[player] > 10 then
warn(tostring(player).." spamming remote")
counts[player] = nil
player:Kick(":(")
return
end
task.delay(1, function()
if counts[player] then
counts[player] -= 1
if counts[player] == 0 then
counts[player] = nil
end
end
end)
local inventoryStore = DataStore2("Inventory", player)
return inventoryStore:Get()
end