Event underneath a for loop not executing

I’ve been getting this weird problem where my “onHumDied” function does not execute. All print functions except “print(death)” properly fires. Is there anything I’m missing or something that I did wrong? Any kind of help is greatly appreciated. Thank you for reading!

   for _,attacker in pairs(attackers)do
		local plr = game.Players:FindFirstChild(attacker)
		print(tostring(plr.Character))
		local hum = plr.Character:FindFirstChildOfClass("Humanoid")
		print(hum.WalkSpeed)
		local onHumDied = hum.Died:Connect(function()
			print("death")
			attSpawns -= 1
			onSpawnChange(attTeam)
		end)
		print("checking for on character death...")
	end

Please ask questions if you are confused about any of my code.

for _,attacker in pairs(attackers)do
	local plr = game.Players:FindFirstChild(attacker)
	print(tostring(plr.Character))
	local hum = plr.Character:FindFirstChildOfClass("Humanoid")
	print(hum.WalkSpeed)
	hum.Died:Connect(function()
		print("death")
		attSpawns -= 1
		onSpawnChange(attTeam)
	end)
	print("checking for on character death...")
end

I’ve tried doing it but it somehow doesn’t work. Thanks for the reply tho man!

I’m assuming this isn’t the entire script, the issue must be elsewhere.

Yeah I found the issue. I would reload the characters beforehand and it would load in a different humanoid that the event doesn’t check for. Thank you for trying to help even tho I had useless info XD .