[ok i found solution]
script.Parent.Transparency = 1
while wait(math.random(29, 90)) do -- random time to spawn
z = game.ReplicatedStorage.zombie:Clone()
local hp = z.Humanoid.MaxHealth
z:MoveTo(script.Parent.Position) -- move to the spawner's location
z.Parent = workspace
z.Humanoid.MaxHealth = math.random(25,100) -- random health
z.Humanoid.Health = z.Humanoid.MaxHealth
if hp < 50 then --change skin collor due to health
z["Left Arm"].Color = Color3.fromRGB(39, 70, 45)
z["Right Arm"].Color = Color3.fromRGB(39, 70, 45)
z["Head"].Color = Color3.fromRGB(39, 70, 45)
else
z["Left Arm"].Color = Color3.fromRGB(52, 142, 64)
z["Right Arm"].Color = Color3.fromRGB(52, 142, 64)
z["Head"].Color = Color3.fromRGB(52, 142, 64)
end
end
it just ignores line 6 for some reason [ok i found solution]

4 comments
I'm pretty sure that the humanoid is what you are supposed to call MoveTo() with
So just change line 6 to z.Humanoid:MoveTo(script.Parent.Position)
Any errors?
No errors but the first time i wrote without z:MoveTo it worked now it doesnt work and the z.humanoid:moveto(script.parent.position) doesnt work