This is script
local collector = game:GetService("CollectionService")
workspace.DescendantAdded:Connect(function(des)
if collector:HasTag(des,"AI") then
print("NewZombie")
local NewThread = coroutine.create(function()
local Anim = des.Zombie:LoadAnimation(script.Animation)
print("2")
while wait(1) do
print("Cycle")
if des.Zombie.MoveDirection.Magnitude > 0 then
print("run")
local SpeedFactor = des.Zombie.WalkSpeed / 16
Anim:AdjustSpeed(SpeedFactor)
if Anim.IsPlaying ~= true then
Anim:Play()
end
else
print("stop")
if Anim.IsPlaying ~= false then
Anim:Stop()
end
end
end
end)
coroutine.resume(NewThread)
end
end)
When I remove the LoadAnimation and all the rest about it, the script works fine and it prints 2.
When I put the LoadAnimation back, it only prints NewZombie and no 2.