My Attack Script Wont Disable/Stop (Humanoid.Died Event)

I’ve been stuck on my script quite a while now and tried to do various thing’s to make it work but none came out positive. I am trying to make the script stop/disable when the NPC finally kills the player.

I tried to use a disabled clone of the script then destroying the old one and I tried Indentation.

My Entire Script: (Sorry if it looks weirdly organised this is just how I like the way my scripts look)

 --ANIMATION
local Animations = {
    "rbxassetid://4527091153","rbxassetid://4527084389","rbxassetid://4527075451"
}
local Animation = Animations[math.random(1,#Animations)]

script.Parent.Animation.AnimationId = Animation
local hum = script.Parent.Parent.Humanoid

local anim = hum:LoadAnimation((script.Parent.Animation))

--SOUND
local Sounds = {
    "rbxassetid://3211793636","rbxassetid://338586299"
}
local Sound = Sounds[math.random(1,#Sounds)]

local SwingSound = script.Parent.SwordSwing
local SwordHit = script.Parent.SwordHit
SwingSound.SoundId = Sound

local IsHum = script.Parent.Parent:FindFirstChildOfClass("Humanoid") 
local CanDamage = script.Parent.Parent:WaitForChild("CanDamage")

script.Parent.Touched:Connect(function(hit)

if hit and hit.Parent then
if not hit then return end
if not CanDamage.Value then return end  
local enemyHumanoid = hit.Parent:FindFirstChild("Humanoid")
if enemyHumanoid == IsHum or hit.Parent:FindFirstChild("NPCWaterKingdomVALUE") then return end
if enemyHumanoid then
enemyHumanoid:TakeDamage(100)
anim:Play()
SwingSound:Play()
SwordHit:Play()
script.Disabled = true
CanDamage.Value = false

wait(1)

anim:Stop()
CanDamage.Value = true
script.Disabled = false


enemyHumanoid.Died:Connect(function()
script.Parent.Parent.Chase.Disabled = true
script.Parent.Parent.NPCMovement.Disabled = false
script.Parent.Humanoid.WalkSpeed = 12
script.Disabled = false
script.Disabled = true
end)

end
end
end)

The Script I’m Stuck With

enemyHumanoid.Died:Connect(function()
script.Parent.Parent.Chase.Disabled = true
script.Parent.Parent.NPCMovement.Disabled = false
script.Parent.Humanoid.WalkSpeed = 12
script.Disabled = false
script.Disabled = true
end)

you will have to create another thread in order to detect when they died and run the things above it at the same time

Doesn’t work unfortunately I tried using “spawn(function()” but that doesn’t work either.

try making a coroutine, make sure to put the ends in correct spaces

Even coroutine seems to not work I have a feeling that the Died.Event isn’t firing properly.
I tried to get rid of all the “script.Disabled” lines but that doesn’t work either.

Ok I fixed the script by copying two scripts on each side of the “wait()” and getting rid of the function I figured out that “wait()” was bugging the values. You probably already said that Btkelley17 and I miss interpreted of what you said so obviously you solved it right from the start. Thanks Mate.