local debounce = false
local Box = Instance.new("Part", Player.Character)
Box.Size = Vector3.new(3, 5, 3)
Box.CanCollide = false
Box.Anchored = false
Box.Transparency = 1
Box.Name = "Box"
local boxweld = Instance.new('Weld')
boxweld.Name = "CWelds"
boxweld.Part0 = Player.Character.Torso
boxweld.Part1 = Box
boxweld.Parent = Player.Character.Torso
boxweld.C0 = CFrame.new(0, -1, -2)*CFrame.Angles(0, 0, 0)
wait(0.1)
Box.Touched:connect(function(part)
local h = part.Parent:FindFirstChild("Humanoid")
if h and (not debounce) and (h.Parent ~= Player.Character) then
debounce = true
h:TakeDamage(math.random(10, 14))
Box:Destroy()
elseif h == nil then
wait(0.1)
Box:Destroy()
end
end)
This is a piece of code that I took from a larger script I made, everything works fine but on line 27 the "Box" doesn't destroy.

3 comments
Box isn't destroying because 'h' still exists.
Why would you check for h being == to nil then destroy it. I do not understand this logic; is it only me?
No @Obscure it isn't only you but I think he was trying to see if the humanoid no longer exists?