I'm making a death animations script and upon testing, the error
Workspace.Character.DeathAnims:4:attempt to index nil with 'WaitForChild'
appears in the output
local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local backUpChar = char:Clone()
backUpChar:WaitForChild("DeathAnims"):Destroy()
hum.Died:Connect(function()
local deathPos = char.HumanoidRootPart.Position
local deathOri = char.HumanoidRootPart.Orientation
local bac = backUpChar:Clone()
local destme = char
script.Parent = bac.Humanoid
destme:Destroy()
bac.Parent = workspace
bac.HumanoidRootPart.Position = deathPos
bac.HumanoidRootPart.Orientation = deathOri
bac:MakeJoints()
hum = bac.Humanoid
hum.HealthDisplayDistance = 0
hum.MaxHealth = math.huge
hum.Health = math.huge
local death_Anim = Instance.new("Animation")
death_Anim.AnimationId = 'rbxassetid://4643698669'
local track = hum:LoadAnimation(death_Anim)
--script.Parent.Parent.HumanoidRootPart.Anchored = true
track.Priority = Enum.AnimationPriority.Action
track:Play()
wait(0.66)
hum.Health = 0
script:Destroy()
end)

2 comments
Good answer
Huh. Never knew what the property really did. Thanks!