What's wrong with my script?

So I have 2 scripts

remote.OnServerEvent:Connect(function(Iskandar)
	for _, plr in pairs(game.Players:GetChildren()) do 
		task.spawn(function()
			local prevposition = plr.Character.HumanoidRootPart.CFrame
			local xOffset = math.random(-50,50)
			local zOffset = math.random(-50,50)
			if (plr.Character.HumanoidRootPart.Position - Iskandar.Character.HumanoidRootPart.Position).Magnitude <= 100 then
				plr.Character.HumanoidRootPart.CFrame = CFrame.new(1549.508 + xOffset, 4210.445, 3454.124 + zOffset)		
			end	
			task.wait(6)
			plr.Character.HumanoidRootPart.CFrame = prevposition
		end)
	end
end)

Which works perfectly until, this.

local RomanRoot = script.Parent.HumanoidRootPart
local RomanHumanoid = script.Parent.Humanoid
local Model = script.Parent
local ss = game:GetService("ServerStorage")
	
local function findenemy()
	local aggro = 500
	local target = nil
	local dmgrange = 7
	for i, v in pairs(game.Workspace:GetChildren()) do
		local human = v:FindFirstChild("Humanoid")
		local root = v:FindFirstChild("HumanoidRootPart")
		if human and root and v ~= script.Parent then
			
			if v.Name ~= "RomanSoldier" then
			if (RomanRoot.Position - root.Position).Magnitude < aggro then
				aggro = (RomanRoot.Position - root.Position).Magnitude
					target = root
					if human.Health > 0 then 
				if (RomanRoot.Position - root.Position).Magnitude <= dmgrange then
							human.Health = human.Health - 15
					  end	
				   end
				end
			end
		end
	end
	return target
end
while wait(1) do
	local torso = findenemy()
	if torso then
		RomanHumanoid:MoveTo(torso.Position)	
	end
	
end

The problem is the “return target” at the bottom of the second script(line28). If I put the return target line there it will teleport me and the soldiers will attack which is a good thing but other people didn’t get teleported along with me. if I put “return target” 1 line above the end above it, it will teleport everyone which is a good thing but another problem showed up and the soldier won’t move and attack anyone. What do you guys think is the problem? This all used to work perfectly until I added in if human.Health > 0 then(line19) .