In my game, there’re parts that will kill the players, however, I want to destroy these bricks later on. But inside the script, there is a table called debounces (basically cooldown). Would it get garbage collect the table debounces
in this code after the bricks have been destroyed and connections are disconnected?
local Players = game:GetService("Players")
local debounces = {}
part.Touched:Connect(function(hit)
local plr = Players:GetPlayerFromCharacter(hit.Parent)
if plr and not debounces[plr] then
debounces[plr] = true
hit.Parent.Humanoid.Health = 0
wait(1)
debounces[plr] = false
end
end)