Hello, I am making a barrage move for my jojo game and the thing I want to do is that when the hitbox hits a humanoid it blacklists it for 0.1 seconds so that it can’t be hit for 0.1 seconds. But that for some reason doesnt work.
Heres what is happening : (the damage is 1.25)
Code :
Connection = RunService.Heartbeat:Connect(function()
Character.HumanoidRootPart.StandPosition.Position = Vector3.new(0,0,-3)
for i,v in pairs(workspace:GetPartsInPart(Hitbox,OverlapParam)) do
if table.find(blacklist,v) == nil then
table.insert(blacklist,v)
v.Parent.Humanoid.Health -= 1.25
task.delay(0.1,function()
table.remove(blacklist,table.find(blacklist,v))
end)
end
end
end)
Could probably check if the PARENT of the part has been affected,. instead of the part itself. Players have a lot of parts in them which could have unwanted effects with your code
Connection = RunService.Heartbeat:Connect(function()
Character.HumanoidRootPart.StandPosition.Position = Vector3.new(0,0,-3)
for i,v in pairs(workspace:GetPartsInPart(Hitbox,OverlapParam)) do
if table.find(blacklist,v.Parent) then
table.insert(blacklist,v.Parent)
v.Parent.Humanoid.Health -= 1.25
task.delay(0.1,function()
table.remove(blacklist,table.find(blacklist,v))
end)
end
end
end)