local N={}local V=tick()local A,i local t=tick()local G=50 local K=100 local o=nil for V,A in next,animations do N[A.Name]=hum:LoadAnimation(A)end function Attack(i,t)if tick()-V>2 then hum:MoveTo(root.Position)V=tick()N.AntWalk:Stop()N.AntMelee:Play()if i.ClassName=="\080\108\097\121\101\114"then root.FleshHit:Play()ant:SetPrimaryPartCFrame(CFrame.new(root.Position,Vector3.new(A.Character.PrimaryPart.Position.X,root.Position.Y,A.Character.PrimaryPart.Position.Z)))elseif i.ClassName=="\077\111\100\101\108"then root.StructureHit:Play()end rep.Events.NPCAttack:Fire(i,t)end end function Move(V)hum:MoveTo(V)if not N.AntWalk.IsPlaying then N.AntWalk:Play()end end function ScanForPoint()local N local V=Vector3.new(math.random(-100,100)/100,0,math.random(-100,100)/100)local A=Ray.new(root.Position,V*math.random(10,50),ant)local i,t=workspace:FindPartOnRay(A)Move(t)enRoute=true end


local anims = {}
local lastAttack= tick()

local target,targetType

local lastLock = tick()

local fleshDamage = 50
local structureDamage = 100

local path = nil


for _,animObject in next,animations do
anims[animObject.Name] = hum:LoadAnimation(animObject)
end

function Attack(thing,dmg)
if tick()-lastAttack > 2 then
hum:MoveTo(root.Position)
lastAttack = tick()
anims.AntWalk:Stop()
anims.AntMelee:Play()

if thing.ClassName == "Player" then
root.FleshHit:Play()
ant:SetPrimaryPartCFrame(CFrame.new(root.Position,Vector3.new(target.Character.PrimaryPart.Position.X,root.Position.Y,target.Character.PrimaryPart.Position.Z)))

elseif thing.ClassName == "Model" then
root.StructureHit:Play()
end

rep.Events.NPCAttack:Fire(thing,dmg) 
end
end


function Move(point)
hum:MoveTo(point)
if not anims.AntWalk.IsPlaying then
anims.AntWalk:Play()
end
end

function ScanForPoint()
local newPoint
local rayDir = Vector3.new(math.random(-100,100)/100,0,math.random(-100,100)/100)
local ray = Ray.new(root.Position,rayDir*math.random(10,50),ant)
local part,pos = workspace:FindPartOnRay(ray)
Move(pos)
enRoute = true
end