I want it to be when the player touches the hitbox then they’re name will be put in a table and they will be blacklisted from taking damage again until the cooldown is done, however the problem is that when I try this the player still takes multiple damage (for each part of the character)
--This is section of script with the issue
local Blacklist = {}
local HitParts = workspace:GetPartBoundsInBox(Hitbox.CFrame, Hitbox.Size, overlapParams)
for _, Part in pairs(HitParts) do
local Humanoid = Part.Parent:FindFirstChild("Humanoid")
if Humanoid and not Part:IsDescendantOf(Character) then
local EnemyHumanoid = Humanoid
local EnemyCharacter = EnemyHumanoid.Parent
local EnemyRootPart = Character:FindFirstChild("HumanoidRootPart")
if not Blacklist[EnemyHumanoid ] then
Blacklist[EnemyHumanoid ] = true
EnemyHumanoid :TakeDamage(BaseDamage)
wait(1)
if Blacklist[EnemyHumanoid ] then
Blacklist[EnemyHumanoid ] = nil
end
end
end
end