local F=50 local x=false local k=false local A=true local R=true local v=0 local m=Instance.new("\087\101\108\100",npc["\065\075-\052\055"])m.Part0=rightarm m.Part1=npc["\065\075-\052\055"]function walkanim(F)if F>5 then x=true else x=false end end npchumanoid.Running:connect(walkanim)function randomwalk()while wait(math.random(3,6))do if not k and not x then npchumanoid.WalkSpeed=16 local function F()local x=Instance.new("\080\097\114\116",npc)x.Size=Vector3.new(1,1,1)x.Anchored=true x.Material="\078\101\111\110"x.Transparency=1 x.BrickColor=BrickColor.new("\077\097\114\111\111\110")x.CFrame=torso.CFrame*CFrame.new(math.random(-60,60),math.random(-30,30),math.random(-60,60))local k=(game:GetService("\080\097\116\104\102\105\110\100\105\110\103\083\101\114\118\105\099\101")):FindPathAsync(torso.Position,x.Position)local A=k:GetWaypoints()if k.Status==Enum.PathStatus.Success then for F,x in pairs(A)do local k=Instance.new("\080\097\114\116",npc)k.Size=Vector3.new(1,1,1)k.Anchored=true k.Material="\078\101\111\110"k.Transparency=1 k.Position=x.Position k.Name="\112\111\115\112\097\114\116"k.CanCollide=false end for F,x in pairs(A)do npchumanoid:MoveTo(x.Position)local k=0 while(torso.Position-x.Position).magnitude>4 and k<35 do k=k+1 wait()end if x.Action==Enum.PathWaypointAction.Jump then npchumanoid.Jump=true end end for F,x in pairs(npc:GetChildren())do if x.Name=="\112\111\115\112\097\114\116"then x:destroy()end end else F()wait()end x:destroy()end F()end end end function checkandshoot()while wait()do v=v+1 if v==500 then R=true v=0 end for v,m in pairs(workspace:GetChildren())do if m.ClassName=="\077\111\100\101\108"and m.Name~="\082\117\102\117\115\049\052"then local v=m:findFirstChildOfClass("\072\117\109\097\110\111\105\100")local M=m:findFirstChild("\072\101\097\100")if v and(M and m.Name~=npc.Name)then if(M.Position-head.Position).magnitude<F then if v.Name=="\110\111\110\101\111\102\117\114\098\117\115\105\110\101\115\115"and R then elseif not k and(v.Health>0 and A)then k=true x=false local R=0 local m=npchumanoid.Health local q=0 npchumanoid.WalkSpeed=0 while k and((M.Position-head.Position).magnitude<F and(v.Health>0 and A))do R=R+1 q=q+1 if npchumanoid.PlatformStand==false then npc.HumanoidRootPart.CFrame=CFrame.new(npc.HumanoidRootPart.Position,Vector3.new(M.Position.x,npc.HumanoidRootPart.Position.y,M.Position.z))end if q==100 and not x then local function F()local x=Instance.new("\080\097\114\116",npc)x.Size=Vector3.new(1,1,1)x.Anchored=true x.Material="\078\101\111\110"x.Transparency=1 x.BrickColor=BrickColor.new("\077\097\114\111\111\110")x.CFrame=torso.CFrame*CFrame.new(-math.random(20,60),math.random(-40,40),math.random(-10,10))local R=(game:GetService("\080\097\116\104\102\105\110\100\105\110\103\083\101\114\118\105\099\101")):FindPathAsync(torso.Position,x.Position)local v=R:GetWaypoints()if R.Status==Enum.PathStatus.Success then k=false A=false npchumanoid.WalkSpeed=20 for F,x in pairs(v)do local k=Instance.new("\080\097\114\116",npc)k.Size=Vector3.new(1,1,1)k.Anchored=true k.Material="\078\101\111\110"k.Transparency=1 k.Position=x.Position k.Name="\112\111\115\112\097\114\116"k.CanCollide=false end for F,x in pairs(v)do npchumanoid:MoveTo(x.Position)local k=0 while(torso.Position-x.Position).magnitude>4 and k<35 do k=k+1 wait()end if x.Action==Enum.PathWaypointAction.Jump then npchumanoid.Jump=true end end A=true npchumanoid.WalkSpeed=16 for F,x in pairs(npc:GetChildren())do if x.Name=="\112\111\115\112\097\114\116"then x:destroy()end end else F()wait()end x:destroy()end F()end if R==2 then R=0 npc["\065\075-\052\055"].shoot:Play()local F=Instance.new("\080\097\114\116",npc)F.Size=Vector3.new(.3,.3,3.5)F.Material="\078\101\111\110"F.CFrame=npc["\065\075-\052\055"].CFrame*CFrame.new(0,0,-4)F.CanCollide=false local x=Instance.new("\066\111\100\121\086\101\108\111\099\105\116\121",F)x.MaxForce=Vector3.new(math.huge,math.huge,math.huge)F.CFrame=CFrame.new(F.Position,M.Position)x.Velocity=F.CFrame.lookVector*500+Vector3.new(math.random(-20,20),math.random(-20,20),0)local k=Instance.new("\080\111\105\110\116\076\105\103\104\116",npc["\065\075-\052\055"])game.Debris:AddItem(k,.1)local function A(x)local k=math.random(1,5)if x.Parent.ClassName~="\065\099\099\101\115\115\111\114\121"and(x.Parent.Parent.ClassName~="\065\099\099\101\115\115\111\114\121"and(x.ClassName~="\065\099\099\101\115\115\111\114\121"and(x.Parent.Name~=npc.Name and x.CanCollide==true)))then F:destroy()local A=x.Parent:findFirstChildOfClass("\072\117\109\097\110\111\105\100")if A then if A.Health>k then A:TakeDamage(k)else A:TakeDamage(k)end end end end game.Debris:AddItem(F,5)F.Touched:connect(A)end wait()end x=false k=false end end end end end end end function run()while wait()do local F=npchumanoid.Health wait()if npchumanoid.Health<F then local F=math.random(1,1)if F==1 and not x then local function F()local R=Instance.new("\080\097\114\116",npc)R.Size=Vector3.new(1,1,1)R.Anchored=true R.Material="\078\101\111\110"R.Transparency=1 R.BrickColor=BrickColor.new("\077\097\114\111\111\110")R.CFrame=torso.CFrame*CFrame.new(math.random(20,60),math.random(-20,20),math.random(-60,60))local v=(game:GetService("\080\097\116\104\102\105\110\100\105\110\103\083\101\114\118\105\099\101")):FindPathAsync(torso.Position,R.Position)local m=v:GetWaypoints()if v.Status==Enum.PathStatus.Success then k=false A=false x=true npchumanoid.WalkSpeed=20 for F,x in pairs(m)do local k=Instance.new("\080\097\114\116",npc)k.Size=Vector3.new(1,1,1)k.Anchored=true k.Material="\078\101\111\110"k.Transparency=1 k.Position=x.Position k.Name="\112\111\115\112\097\114\116"k.CanCollide=false end for F,x in pairs(m)do npchumanoid:MoveTo(x.Position)local k=0 while(torso.Position-x.Position).magnitude>4 and k<35 do k=k+1 wait()end if x.Action==Enum.PathWaypointAction.Jump then npchumanoid.Jump=true end end k=false A=true x=false npchumanoid.WalkSpeed=16 for F,x in pairs(npc:GetChildren())do if x.Name=="\112\111\115\112\097\114\116"then x:destroy()end end else F()wait()end R:destroy()end F()end end end end function death()if head:findFirstChild("\084\104\101 \080\114\111\100\105\103\121 - \086\111\111\100\111\111 \080\101\111\112\108\101 \040\080\101\110\100\117\108\117\109 \082\101\109\105\120\041")then head["\084\104\101 \080\114\111\100\105\103\121 - \086\111\111\100\111\111 \080\101\111\112\108\101 \040\080\101\110\100\117\108\117\109 \082\101\109\105\120\041"]:destroy()end if npc:findFirstChild("\072\101\097\108\116\104")then npc.Health.Disabled=true end npchumanoid.Archivable=true local F=npchumanoid.Parent:Clone()npchumanoid.Parent:destroy()F.Parent=workspace game.Debris:AddItem(F,15)local x=F:findFirstChildOfClass("\072\117\109\097\110\111\105\100")local k=F.Torso x.PlatformStand=true x:SetStateEnabled("\068\101\097\100",false)for F,x in pairs(x.Parent.Torso:GetChildren())do if x.ClassName=="\077\111\116\111\114\054\068"or x.ClassName=="\087\101\108\100"then x:destroy()end end for F,x in pairs(F:GetChildren())do if x.ClassName=="\080\097\114\116"then for F,x in pairs(x:GetChildren())do if x.ClassName=="\066\111\100\121\080\111\115\105\116\105\111\110"or x.ClassName=="\066\111\100\121\086\101\108\111\099\105\116\121"then x:destroy()end end end end local function A(F,x,k,A,R,v)local m=Instance.new("\066\097\108\108\083\111\099\107\101\116\067\111\110\115\116\114\097\105\110\116",F)m.LimitsEnabled=true m.Attachment0=x m.Attachment1=k m.TwistLimitsEnabled=true m.TwistLowerAngle=A m.TwistUpperAngle=R m.UpperAngle=70 end local function R(F,x,k,A,R,v)local m=Instance.new("\072\105\110\103\101\067\111\110\115\116\114\097\105\110\116",F)m.Attachment0=x m.Attachment1=k m.LimitsEnabled=true m.LowerAngle=A m.UpperAngle=R end x.Parent["\082\105\103\104\116 \065\114\109"].RightShoulderAttachment.Position=Vector3.new(0,.5,0)k.RightCollarAttachment.Position=Vector3.new(1.5,.5,0)x.Parent["\076\101\102\116 \065\114\109"].LeftShoulderAttachment.Position=Vector3.new(0,.5,0)k.LeftCollarAttachment.Position=Vector3.new(-1.5,.5,0)local v=Instance.new("\065\116\116\097\099\104\109\101\110\116",x.Parent["\082\105\103\104\116 \076\101\103"])v.Position=Vector3.new(0,1,0)local m=Instance.new("\065\116\116\097\099\104\109\101\110\116",k)m.Position=Vector3.new(.5,-1,0)local M=Instance.new("\065\116\116\097\099\104\109\101\110\116",x.Parent["\076\101\102\116 \076\101\103"])M.Position=Vector3.new(0,1,0)local q=Instance.new("\065\116\116\097\099\104\109\101\110\116",k)q.Position=Vector3.new(-0.5,-1,0)if x.Parent:findFirstChild("\072\101\097\100")then local F=Instance.new("\065\116\116\097\099\104\109\101\110\116",x.Parent.Head)F.Position=Vector3.new(0,-0.5,0)R(x.Parent.Head,F,k.NeckAttachment,-20,20,70)end A(x.Parent["\082\105\103\104\116 \065\114\109"],x.Parent["\082\105\103\104\116 \065\114\109"].RightShoulderAttachment,k.RightCollarAttachment,-80,80)A(x.Parent["\076\101\102\116 \065\114\109"],x.Parent["\076\101\102\116 \065\114\109"].LeftShoulderAttachment,k.LeftCollarAttachment,-80,80)A(x.Parent["\082\105\103\104\116 \076\101\103"],v,m,-80,80,70)A(x.Parent["\076\101\102\116 \076\101\103"],M,q,-80,80,70)if x.Parent:findFirstChild("\082\105\103\104\116 \065\114\109")then local k=Instance.new("\080\097\114\116",x.Parent["\082\105\103\104\116 \065\114\109"])k.Size=Vector3.new(1,1.3,1)k.Shape="\067\121\108\105\110\100\101\114"k.Transparency=1 local A=Instance.new("\087\101\108\100",k)A.Part0=x.Parent["\082\105\103\104\116 \065\114\109"]A.Part1=k A.C0=CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)*CFrame.new(-0.4,0,0)for F,x in pairs(F["\082\105\103\104\116 \065\114\109"]:GetChildren())do if x.ClassName=="\077\111\116\111\114\054\068"or x.ClassName=="\087\101\108\100"then x:destroy()end end end if x.Parent:findFirstChild("\076\101\102\116 \065\114\109")then local F=Instance.new("\080\097\114\116",x.Parent["\076\101\102\116 \065\114\109"])F.Size=Vector3.new(1,1.3,1)F.Shape="\067\121\108\105\110\100\101\114"F.Transparency=1 local k=Instance.new("\087\101\108\100",F)k.Part0=x.Parent["\076\101\102\116 \065\114\109"]k.Part1=F k.C0=CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)*CFrame.new(-0.4,0,0)end if x.Parent:findFirstChild("\076\101\102\116 \076\101\103")then local F=Instance.new("\080\097\114\116",x.Parent["\076\101\102\116 \076\101\103"])F.Size=Vector3.new(1,1.3,1)F.Shape="\067\121\108\105\110\100\101\114"F.Transparency=1 local k=Instance.new("\087\101\108\100",F)k.Part0=x.Parent["\076\101\102\116 \076\101\103"]k.Part1=F k.C0=CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)*CFrame.new(-0.4,0,0)end if x.Parent:findFirstChild("\082\105\103\104\116 \076\101\103")then local F=Instance.new("\080\097\114\116",x.Parent["\082\105\103\104\116 \076\101\103"])F.Size=Vector3.new(1,1.3,1)F.Shape="\067\121\108\105\110\100\101\114"F.Transparency=1 local k=Instance.new("\087\101\108\100",F)k.Part0=x.Parent["\082\105\103\104\116 \076\101\103"]k.Part1=F k.C0=CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)*CFrame.new(-0.4,0,0)end local B=F if B:findFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")then B.HumanoidRootPart.CanCollide=false B.HumanoidRootPart:destroy()end end npchumanoid.Died:connect(death)spawn(run)spawn(checkandshoot)spawn(randomwalk)while wait()do if not x and not k then for F=.2,.8,.09 do if not x and not k then m.C0=m.C0:lerp(CFrame.new(-0.583096504,-1.87343168,.0918724537,.808914721,-0.582031429,.0830438882,-0.166903317,-0.0918986499,.981681228,-0.56373775,-0.807956576,-0.171481162),F)rightshoulder.C0=rightshoulder.C0:lerp(CFrame.new(1.32261992,.220639229,-0.279059082,.766044497,.604022682,-0.219846413,-0.492403805,.331587851,-0.804728508,-0.413175881,.724711061,.551434159),F)leftshoulder.C0=leftshoulder.C0:lerp(CFrame.new(-1.16202736,-0.00836706161,-0.880517244,.939692557,-0.342020094,-2.98023224e-08,.171009958,.46984598,-0.866025567,.296198159,.813797832,.499999642),F)lefthip.C0=lefthip.C0:lerp(CFrame.new(-0.599619389,-1.99128425,0,.996194661,.087155968,0,-0.087155968,.996194661,0,0,0,1),F)righthip.C0=righthip.C0:lerp(CFrame.new(.599619389,-1.99128449,0,.996194661,-0.087155968,0,.087155968,.996194661,0,0,0,1),F)root.C0=root.C0:lerp(CFrame.new(0,0,0),F)neck.C0=neck.C0:lerp(CFrame.new(0,1.5,0),F)wait()end end end if x then for F=.2,.8,.09 do if x then m.C0=m.C0:lerp(CFrame.new(-0.583096504,-1.87343168,.0918724537,.808914721,-0.582031429,.0830438882,-0.166903317,-0.0918986499,.981681228,-0.56373775,-0.807956576,-0.171481162),F)rightshoulder.C0=rightshoulder.C0:lerp(CFrame.new(1.32261992,.220639229,-0.279059082,.766044497,.604022682,-0.219846413,-0.492403805,.331587851,-0.804728508,-0.413175881,.724711061,.551434159),F)leftshoulder.C0=leftshoulder.C0:lerp(CFrame.new(-1.16202736,-0.00836706161,-0.880517244,.939692557,-0.342020094,-2.98023224e-08,.171009958,.46984598,-0.866025567,.296198159,.813797832,.499999642),F)lefthip.C0=lefthip.C0:lerp(CFrame.new(-0.527039051,-1.78302765,.642787695,.999390841,.026734557,.0224329531,-0.0348994918,.765577614,.642395973,0,-0.642787635,.766044438),F)righthip.C0=righthip.C0:lerp(CFrame.new(.522737741,-1.65984559,-0.766044617,.999390841,-0.0224329531,.0267345682,.0348994918,.642395794,-0.765577734,0,.766044497,.642787457),F)root.C0=root.C0:lerp(CFrame.new(0,0,0,.996194661,6.98491931e-09,-0.0871561021,.00759615982,.996194661,.0868242308,.0868244469,-0.087155886,.992403805),F)neck.C0=neck.C0:lerp(CFrame.new(2.38418579e-07,1.49809694,.0435779095,.996194661,6.38283382e-09,.0871560946,.00759615889,.996194601,-0.0868242308,-0.0868244469,.087155886,.992403746),F)wait()end end head.footstep:Play()for F=.2,.8,.09 do if x then m.C0=m.C0:lerp(CFrame.new(-0.583096504,-1.87343168,.0918724537,.808914721,-0.582031429,.0830438882,-0.166903317,-0.0918986499,.981681228,-0.56373775,-0.807956576,-0.171481162),F)rightshoulder.C0=rightshoulder.C0:lerp(CFrame.new(1.32261992,.220639229,-0.279059082,.766044497,.604022682,-0.219846413,-0.492403805,.331587851,-0.804728508,-0.413175881,.724711061,.551434159),F)leftshoulder.C0=leftshoulder.C0:lerp(CFrame.new(-1.16202736,-0.00836706161,-0.880517244,.939692557,-0.342020094,-2.98023224e-08,.171009958,.46984598,-0.866025567,.296198159,.813797832,.499999642),F)lefthip.C0=lefthip.C0:lerp(CFrame.new(-0.520322084,-1.59067655,-0.819151878,.999390841,.0200175196,-0.028587997,-0.0348994918,.573226929,-0.818652987,0,.819151998,.57357645),F)righthip.C0=righthip.C0:lerp(CFrame.new(.528892756,-1.83610249,.573575974,.999390841,-0.0285879895,-0.020017527,.0348994955,.818652987,.57322675,-7.4505806e-09,-0.573576212,.819152057),F)root.C0=root.C0:lerp(CFrame.new(0,0,0,.996194661,-1.44354999e-08,.0871558934,-0.00759615237,.996194661,.0868244395,-0.0868242383,-0.0871560946,.992403805),F)neck.C0=neck.C0:lerp(CFrame.new(0,1.49809742,.0435781479,.996194601,-1.27129169e-08,-0.0871559009,-0.0075961519,.996194661,-0.0868244097,.0868242458,.0871560723,.992403746),F)wait()end end head.footstep:Play()end if k then for F=.2,.8,.45 do if k then m.C0=m.C0:lerp(CFrame.new(-0.109231472,-2.24730468,-0.300003052,.984807491,1.94707184e-07,.173647866,-0.173648044,-2.68220873e-07,.984807491,3.67846468e-07,-0.999999821,-8.00420992e-08),F)root.C0=root.C0:lerp(CFrame.new(0,0,0,.173648223,0,-0.98480773,0,1,0,.98480773,0,.173648223),F)rightshoulder.C0=rightshoulder.C0:lerp(CFrame.new(1.21384871,.500000477,-0.879925251,.342019856,.939692438,-1.49501886e-08,1.94707184e-07,-2.68220873e-07,-0.999999821,-0.939692438,.342020035,-3.76157232e-07),F)leftshoulder.C0=leftshoulder.C0:lerp(CFrame.new(-1.59201181,.470158577,-0.794548988,.271118939,.181368172,.945304275,.902039766,-0.390578717,-0.18377316,.335885108,.902526498,-0.269494623),F)lefthip.C0=lefthip.C0:lerp(CFrame.new(-0.681244373,-2.07163191,0,.98480773,.173648283,0,-0.173648283,.98480767,0,0,-1.86264515e-09,.99999994),F)righthip.C0=righthip.C0:lerp(CFrame.new(.681244612,-2.07163191,-4.76837158e-07,.98480773,-0.173648283,0,.173648283,.98480767,0,0,1.86264515e-09,.99999994),F)neck.C0=neck.C0:lerp(CFrame.new(.0296957493,1.49240398,-0.0815882683,.336824059,.059391167,.939692557,-0.173648164,.98480773,-7.4505806e-09,-0.925416589,-0.163175896,.342020094),F)wait()end end for F=.2,.8,.45 do if k then m.C0=m.C0:lerp(CFrame.new(-0.109231472,-2.24730468,-0.300003052,.984807491,1.94707184e-07,.173647866,-0.173648044,-2.68220873e-07,.984807491,3.67846468e-07,-0.999999821,-8.00420992e-08),F)root.C0=root.C0:lerp(CFrame.new(0,0,0,.173648223,0,-0.98480773,0,1,0,.98480773,0,.173648223),F)rightshoulder.C0=rightshoulder.C0:lerp(CFrame.new(1.60777056,.499999523,-0.81046629,.342019439,.939691842,1.55550936e-07,4.10554577e-08,-3.93739697e-07,-0.999999464,-0.939691901,.342019975,-4.77612389e-07),F)leftshoulder.C0=leftshoulder.C0:lerp(CFrame.new(-1.10000956,.482372284,-0.926761627,.27112025,.263066441,.925899446,.902039289,-0.405109912,-0.149033815,.335885197,.875603914,-0.347129732),F)lefthip.C0=lefthip.C0:lerp(CFrame.new(-0.681244373,-2.07163191,0,.98480773,.173648283,0,-0.173648283,.98480767,0,0,-1.86264515e-09,.99999994),F)righthip.C0=righthip.C0:lerp(CFrame.new(.681244612,-2.07163191,-4.76837158e-07,.98480773,-0.173648283,0,.173648283,.98480767,0,0,1.86264515e-09,.99999994),F)neck.C0=neck.C0:lerp(CFrame.new(.121206045,1.4753027,-0.0450725555,.336823881,.221664757,.915103495,-0.173648164,.969846308,-0.171010077,-0.925416648,-0.101305753,.365159094),F)wait()end end end end

local sight = 50
local walking = false
local shooting = false
local canshoot = true
local cansay = true
local saycooldown = 0
local akweld = Instance.new("Weld", npc["AK-47"])
akweld.Part0 = rightarm
akweld.Part1 = npc["AK-47"]
function walkanim(walkspeed)
	if walkspeed > 5 then
		walking = true
	else
		walking = false
	end
end
npchumanoid.Running:connect(walkanim)
function randomwalk()
	while wait(math.random(3,6)) do
		if not shooting and not walking then
			npchumanoid.WalkSpeed = 16
			local function createwalkpart()
				local walkpart = Instance.new("Part", npc)
				walkpart.Size = Vector3.new(1,1,1)
				walkpart.Anchored = true
				walkpart.Material = "Neon"
				walkpart.Transparency = 1
				walkpart.BrickColor = BrickColor.new("Maroon")
				walkpart.CFrame = torso.CFrame * CFrame.new(math.random(-60,60),math.random(-30,30),math.random(-60,60))
				local path = game:GetService("PathfindingService"):FindPathAsync(torso.Position, walkpart.Position)
				local waypoints = path:GetWaypoints()
				if path.Status == Enum.PathStatus.Success then
					for i,v in pairs(waypoints) do
						local pospart = Instance.new("Part", npc)
						pospart.Size = Vector3.new(1,1,1)
						pospart.Anchored = true
						pospart.Material = "Neon"
						pospart.Transparency = 1
						pospart.Position = v.Position
						pospart.Name = "pospart"
						pospart.CanCollide = false
					end
					for i,v in pairs(waypoints) do
						npchumanoid:MoveTo(v.Position)
						local allow = 0
						while (torso.Position - v.Position).magnitude > 4 and allow < 35 do
							allow = allow + 1
							wait()
						end
						if v.Action == Enum.PathWaypointAction.Jump then
							npchumanoid.Jump = true
						end
					end
					for i,v in pairs(npc:GetChildren()) do
						if v.Name == "pospart" then
							v:destroy()
						end
					end
				else
					createwalkpart()
					wait()
				end
				walkpart:destroy()
			end
			createwalkpart()
		end
	end
end
function checkandshoot()
	while wait() do
		saycooldown = saycooldown + 1
		if saycooldown == 500 then
			cansay = true
			saycooldown = 0
		end
		for i,v in pairs(workspace:GetChildren()) do
			if v.ClassName == "Model" and v.Name ~= "Rufus14" then
				local victimhumanoid = v:findFirstChildOfClass("Humanoid")
				local victimhead = v:findFirstChild("Head")
				if victimhumanoid and victimhead and v.Name ~= npc.Name then
					if (victimhead.Position - head.Position).magnitude < sight then
						if victimhumanoid.Name == "noneofurbusiness" and cansay then
							
						elseif not shooting and victimhumanoid.Health > 0 and canshoot then
							shooting = true
							walking = false
							local doesshoot = 0
							local hpnow = npchumanoid.Health
							local walk = 0
							npchumanoid.WalkSpeed = 0
							while shooting and (victimhead.Position - head.Position).magnitude < sight and victimhumanoid.Health > 0 and canshoot do
								doesshoot = doesshoot + 1
								walk = walk + 1
								if npchumanoid.PlatformStand == false then
									npc.HumanoidRootPart.CFrame = CFrame.new(npc.HumanoidRootPart.Position,Vector3.new(victimhead.Position.x,npc.HumanoidRootPart.Position.y,victimhead.Position.z))
								end
								if walk == 100 and not walking then
									local function createwalkpart()
										local walkpart = Instance.new("Part", npc)
										walkpart.Size = Vector3.new(1,1,1)
										walkpart.Anchored = true
										walkpart.Material = "Neon"
										walkpart.Transparency = 1
										walkpart.BrickColor = BrickColor.new("Maroon")
										walkpart.CFrame = torso.CFrame * CFrame.new(-math.random(20,60),math.random(-40,40),math.random(-10,10))
										local path = game:GetService("PathfindingService"):FindPathAsync(torso.Position, walkpart.Position)
										local waypoints = path:GetWaypoints()
										if path.Status == Enum.PathStatus.Success then
											shooting = false
											canshoot = false
											npchumanoid.WalkSpeed = 20
											for i,v in pairs(waypoints) do
												local pospart = Instance.new("Part", npc)
												pospart.Size = Vector3.new(1,1,1)
												pospart.Anchored = true
												pospart.Material = "Neon"
												pospart.Transparency = 1
												pospart.Position = v.Position
												pospart.Name = "pospart"
												pospart.CanCollide = false
											end
											for i,v in pairs(waypoints) do
												npchumanoid:MoveTo(v.Position)
												local allow = 0
												while (torso.Position - v.Position).magnitude > 4 and allow < 35 do
													allow = allow + 1
													wait()
												end
												if v.Action == Enum.PathWaypointAction.Jump then
													npchumanoid.Jump = true
												end
											end
											canshoot = true
											npchumanoid.WalkSpeed = 16
											for i,v in pairs(npc:GetChildren()) do
												if v.Name == "pospart" then
													v:destroy()
												end
											end
										else
											createwalkpart()
											wait()
										end
										walkpart:destroy()
									end
									createwalkpart()
								end
								if doesshoot == 2 then
									doesshoot = 0
									npc["AK-47"].shoot:Play()
									local bullet = Instance.new("Part", npc)
									bullet.Size = Vector3.new(0.3,0.3,3.5)
									bullet.Material = "Neon"
									bullet.CFrame = npc["AK-47"].CFrame * CFrame.new(0,0,-4)
									bullet.CanCollide = false
									local velocity = Instance.new("BodyVelocity", bullet)
									velocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
									bullet.CFrame = CFrame.new(bullet.Position, victimhead.Position)
									velocity.Velocity = bullet.CFrame.lookVector * 500 + Vector3.new(math.random(-20,20),math.random(-20,20),0)
									local pointlight = Instance.new("PointLight", npc["AK-47"])
									game.Debris:AddItem(pointlight,0.1)
									local function damage(part)
										local damage = math.random(1,5)
										if part.Parent.ClassName ~= "Accessory" and part.Parent.Parent.ClassName ~= "Accessory" and part.ClassName ~= "Accessory" and part.Parent.Name ~= npc.Name and part.CanCollide == true then
											bullet:destroy()
											local victimhumanoid = part.Parent:findFirstChildOfClass("Humanoid")
											if victimhumanoid then
												if victimhumanoid.Health > damage then
													victimhumanoid:TakeDamage(damage)
												else
													victimhumanoid:TakeDamage(damage)
												end
											end
										end
									end
									game.Debris:AddItem(bullet, 5)
									bullet.Touched:connect(damage)
								end
								wait()
							end
							walking = false
							shooting = false
						end
					end
				end
			end
		end
	end
end
function run()
	while wait() do
		local hpnow = npchumanoid.Health
		wait()
		if npchumanoid.Health < hpnow then
			local dorun = math.random(1,1)
			if dorun == 1 and not walking then
				local function createwalkpart()
					local walkpart = Instance.new("Part", npc)
					walkpart.Size = Vector3.new(1,1,1)
					walkpart.Anchored = true
					walkpart.Material = "Neon"
					walkpart.Transparency = 1
					walkpart.BrickColor = BrickColor.new("Maroon")
					walkpart.CFrame = torso.CFrame * CFrame.new(math.random(20,60),math.random(-20,20),math.random(-60,60))
					local path = game:GetService("PathfindingService"):FindPathAsync(torso.Position, walkpart.Position)
					local waypoints = path:GetWaypoints()
					if path.Status == Enum.PathStatus.Success then
						shooting = false
						canshoot = false
						walking = true
						npchumanoid.WalkSpeed = 20
						for i,v in pairs(waypoints) do
							local pospart = Instance.new("Part", npc)
							pospart.Size = Vector3.new(1,1,1)
							pospart.Anchored = true
							pospart.Material = "Neon"
							pospart.Transparency = 1
							pospart.Position = v.Position
							pospart.Name = "pospart"
							pospart.CanCollide = false
						end
						for i,v in pairs(waypoints) do
							npchumanoid:MoveTo(v.Position)
							local allow = 0
							while (torso.Position - v.Position).magnitude > 4 and allow < 35 do
								allow = allow + 1
								wait()
							end
							if v.Action == Enum.PathWaypointAction.Jump then
								npchumanoid.Jump = true
							end
						end
						shooting = false
						canshoot = true
						walking = false
						npchumanoid.WalkSpeed = 16
						for i,v in pairs(npc:GetChildren()) do
							if v.Name == "pospart" then
								v:destroy()
							end
						end
					else
						createwalkpart()
						wait()
					end
					walkpart:destroy()
				end
				createwalkpart()
			end
		end
	end
end
function death()
	if head:findFirstChild("The Prodigy - Voodoo People (Pendulum Remix)") then
		head["The Prodigy - Voodoo People (Pendulum Remix)"]:destroy()
	end
	if npc:findFirstChild("Health") then
		npc.Health.Disabled = true
	end
	npchumanoid.Archivable = true
	local zombiecorpse = npchumanoid.Parent:Clone()
	npchumanoid.Parent:destroy()
	zombiecorpse.Parent = workspace
	game.Debris:AddItem(zombiecorpse, 15)
	local Humanoid = zombiecorpse:findFirstChildOfClass("Humanoid")
	local Torso = zombiecorpse.Torso
	Humanoid.PlatformStand = true
	Humanoid:SetStateEnabled("Dead", false)
	for i,v in pairs(Humanoid.Parent.Torso:GetChildren()) do
		if v.ClassName == 'Motor6D' or v.ClassName == 'Weld' then
			v:destroy()
		end
	end
	for i,v in pairs(zombiecorpse:GetChildren()) do
		if v.ClassName == "Part" then
			for q,w in pairs(v:GetChildren()) do
				if w.ClassName == "BodyPosition" or w.ClassName == "BodyVelocity" then
					w:destroy()
				end
			end
		end
	end
	local function makeconnections(limb, attachementone, attachmenttwo, twistlower, twistupper, upperangle)
		local connection = Instance.new('BallSocketConstraint', limb)
		connection.LimitsEnabled = true
		connection.Attachment0 = attachementone
		connection.Attachment1 = attachmenttwo
		connection.TwistLimitsEnabled = true
		connection.TwistLowerAngle = twistlower
		connection.TwistUpperAngle = twistupper
		connection.UpperAngle = 70
	end
	local function makehingeconnections(limb, attachementone, attachmenttwo, twistlower, twistupper, upperangle)
		local connection = Instance.new('HingeConstraint', limb)
		connection.Attachment0 = attachementone
		connection.Attachment1 = attachmenttwo
		connection.LimitsEnabled = true
		connection.LowerAngle = twistlower
		connection.UpperAngle = twistupper
	end
	Humanoid.Parent['Right Arm'].RightShoulderAttachment.Position = Vector3.new(0, 0.5, 0)
	Torso.RightCollarAttachment.Position = Vector3.new(1.5, 0.5, 0)
	Humanoid.Parent['Left Arm'].LeftShoulderAttachment.Position = Vector3.new(0, 0.5, 0)
	Torso.LeftCollarAttachment.Position = Vector3.new(-1.5, 0.5, 0)
	local RightLegAttachment = Instance.new("Attachment", Humanoid.Parent["Right Leg"])
	RightLegAttachment.Position = Vector3.new(0, 1, 0)
	local TorsoRightLegAttachment = Instance.new("Attachment", Torso)
	TorsoRightLegAttachment.Position = Vector3.new(0.5, -1, 0)
	--
	local LeftLegAttachment = Instance.new("Attachment", Humanoid.Parent["Left Leg"])
	LeftLegAttachment.Position = Vector3.new(0, 1, 0)
	local TorsoLeftLegAttachment = Instance.new("Attachment", Torso)
	TorsoLeftLegAttachment.Position = Vector3.new(-0.5, -1, 0)
	--
	if Humanoid.Parent:findFirstChild("Head") then
		local HeadAttachment = Instance.new("Attachment", Humanoid.Parent.Head)
		HeadAttachment.Position = Vector3.new(0, -0.5, 0)
		makehingeconnections(Humanoid.Parent.Head, HeadAttachment, Torso.NeckAttachment, -20, 20, 70)
	end
	makeconnections(Humanoid.Parent['Right Arm'], Humanoid.Parent['Right Arm'].RightShoulderAttachment, Torso.RightCollarAttachment, -80, 80)
	makeconnections(Humanoid.Parent['Left Arm'], Humanoid.Parent['Left Arm'].LeftShoulderAttachment, Torso.LeftCollarAttachment, -80, 80)
	makeconnections(Humanoid.Parent['Right Leg'], RightLegAttachment, TorsoRightLegAttachment, -80, 80, 70)
	makeconnections(Humanoid.Parent['Left Leg'], LeftLegAttachment, TorsoLeftLegAttachment, -80, 80, 70)
	if Humanoid.Parent:findFirstChild("Right Arm") then
		local limbcollider = Instance.new("Part", Humanoid.Parent["Right Arm"])
		limbcollider.Size = Vector3.new(1,1.3,1)
		limbcollider.Shape = "Cylinder"
		limbcollider.Transparency = 1
		local limbcolliderweld = Instance.new("Weld", limbcollider)
		limbcolliderweld.Part0 = Humanoid.Parent["Right Arm"]
		limbcolliderweld.Part1 = limbcollider
		limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0)
		for i,v in pairs(zombiecorpse["Right Arm"]:GetChildren()) do
			if v.ClassName == 'Motor6D' or v.ClassName == 'Weld' then
				v:destroy()
			end
		end
	end
	--
	if Humanoid.Parent:findFirstChild("Left Arm") then
		local limbcollider = Instance.new("Part", Humanoid.Parent["Left Arm"])
		limbcollider.Size = Vector3.new(1,1.3,1)
		limbcollider.Shape = "Cylinder"
		limbcollider.Transparency = 1
		local limbcolliderweld = Instance.new("Weld", limbcollider)
		limbcolliderweld.Part0 = Humanoid.Parent["Left Arm"]
		limbcolliderweld.Part1 = limbcollider
		limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0)
	end
	--
	if Humanoid.Parent:findFirstChild("Left Leg") then
		local limbcollider = Instance.new("Part", Humanoid.Parent["Left Leg"])
		limbcollider.Size = Vector3.new(1,1.3,1)
		limbcollider.Shape = "Cylinder"
		limbcollider.Transparency = 1
		local limbcolliderweld = Instance.new("Weld", limbcollider)
		limbcolliderweld.Part0 = Humanoid.Parent["Left Leg"]
		limbcolliderweld.Part1 = limbcollider
		limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0)
	end
	--
	if Humanoid.Parent:findFirstChild("Right Leg") then
		local limbcollider = Instance.new("Part", Humanoid.Parent["Right Leg"])
		limbcollider.Size = Vector3.new(1,1.3,1)
		limbcollider.Shape = "Cylinder"
		limbcollider.Transparency = 1
		local limbcolliderweld = Instance.new("Weld", limbcollider)
		limbcolliderweld.Part0 = Humanoid.Parent["Right Leg"]
		limbcolliderweld.Part1 = limbcollider
		limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0)
	end
	local ragdoll = zombiecorpse
	if ragdoll:findFirstChild("HumanoidRootPart") then
		ragdoll.HumanoidRootPart.CanCollide = false
		ragdoll.HumanoidRootPart:destroy()
	end
end
npchumanoid.Died:connect(death)
spawn(run)
spawn(checkandshoot)
spawn(randomwalk)
while wait() do --check animations and other things
	if not walking and not shooting then
		for i = 0.2,0.8 , 0.09 do
			if not walking and not shooting then
				akweld.C0 = akweld.C0:lerp(CFrame.new(-0.583096504, -1.87343168, 0.0918724537, 0.808914721, -0.582031429, 0.0830438882, -0.166903317, -0.0918986499, 0.981681228, -0.56373775, -0.807956576, -0.171481162),i)
				rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.32261992, 0.220639229, -0.279059082, 0.766044497, 0.604022682, -0.219846413, -0.492403805, 0.331587851, -0.804728508, -0.413175881, 0.724711061, 0.551434159),i)
				leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.16202736, -0.00836706161, -0.880517244, 0.939692557, -0.342020094, -2.98023224e-08, 0.171009958, 0.46984598, -0.866025567, 0.296198159, 0.813797832, 0.499999642),i)
				lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.599619389, -1.99128425, 0, 0.996194661, 0.087155968, 0, -0.087155968, 0.996194661, 0, 0, 0, 1),i)
				righthip.C0 = righthip.C0:lerp(CFrame.new(0.599619389, -1.99128449, 0, 0.996194661, -0.087155968, 0, 0.087155968, 0.996194661, 0, 0, 0, 1),i)
				root.C0 = root.C0:lerp(CFrame.new(0,0,0),i)
				neck.C0 = neck.C0:lerp(CFrame.new(0,1.5,0),i)
				wait()
			end
		end
	end
	if walking then --this is the walking animation
		for i = 0.2,0.8 , 0.09 do
			if walking then
				akweld.C0 = akweld.C0:lerp(CFrame.new(-0.583096504, -1.87343168, 0.0918724537, 0.808914721, -0.582031429, 0.0830438882, -0.166903317, -0.0918986499, 0.981681228, -0.56373775, -0.807956576, -0.171481162),i)
				rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.32261992, 0.220639229, -0.279059082, 0.766044497, 0.604022682, -0.219846413, -0.492403805, 0.331587851, -0.804728508, -0.413175881, 0.724711061, 0.551434159),i)
				leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.16202736, -0.00836706161, -0.880517244, 0.939692557, -0.342020094, -2.98023224e-08, 0.171009958, 0.46984598, -0.866025567, 0.296198159, 0.813797832, 0.499999642),i)
				lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.527039051, -1.78302765, 0.642787695, 0.999390841, 0.026734557, 0.0224329531, -0.0348994918, 0.765577614, 0.642395973, 0, -0.642787635, 0.766044438),i)
				righthip.C0 = righthip.C0:lerp(CFrame.new(0.522737741, -1.65984559, -0.766044617, 0.999390841, -0.0224329531, 0.0267345682, 0.0348994918, 0.642395794, -0.765577734, 0, 0.766044497, 0.642787457),i)
				root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.996194661, 6.98491931e-09, -0.0871561021, 0.00759615982, 0.996194661, 0.0868242308, 0.0868244469, -0.087155886, 0.992403805),i)
				neck.C0 = neck.C0:lerp(CFrame.new(2.38418579e-07, 1.49809694, 0.0435779095, 0.996194661, 6.38283382e-09, 0.0871560946, 0.00759615889, 0.996194601, -0.0868242308, -0.0868244469, 0.087155886, 0.992403746),i)
				wait()
			end
		end
		head.footstep:Play()
		for i = 0.2,0.8 , 0.09 do
			if walking then
				akweld.C0 = akweld.C0:lerp(CFrame.new(-0.583096504, -1.87343168, 0.0918724537, 0.808914721, -0.582031429, 0.0830438882, -0.166903317, -0.0918986499, 0.981681228, -0.56373775, -0.807956576, -0.171481162),i)
				rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.32261992, 0.220639229, -0.279059082, 0.766044497, 0.604022682, -0.219846413, -0.492403805, 0.331587851, -0.804728508, -0.413175881, 0.724711061, 0.551434159),i)
				leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.16202736, -0.00836706161, -0.880517244, 0.939692557, -0.342020094, -2.98023224e-08, 0.171009958, 0.46984598, -0.866025567, 0.296198159, 0.813797832, 0.499999642),i)
				lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.520322084, -1.59067655, -0.819151878, 0.999390841, 0.0200175196, -0.028587997, -0.0348994918, 0.573226929, -0.818652987, 0, 0.819151998, 0.57357645),i)
				righthip.C0 = righthip.C0:lerp(CFrame.new(0.528892756, -1.83610249, 0.573575974, 0.999390841, -0.0285879895, -0.020017527, 0.0348994955, 0.818652987, 0.57322675, -7.4505806e-09, -0.573576212, 0.819152057),i)
				root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.996194661, -1.44354999e-08, 0.0871558934, -0.00759615237, 0.996194661, 0.0868244395, -0.0868242383, -0.0871560946, 0.992403805),i)
				neck.C0 = neck.C0:lerp(CFrame.new(0, 1.49809742, 0.0435781479, 0.996194601, -1.27129169e-08, -0.0871559009, -0.0075961519, 0.996194661, -0.0868244097, 0.0868242458, 0.0871560723, 0.992403746),i)
				wait()
			end
		end
		head.footstep:Play()
	end
	if shooting then --this is the shooting animation
		for i = 0.2,0.8 , 0.45 do
			if shooting then
				akweld.C0 = akweld.C0:lerp(CFrame.new(-0.109231472, -2.24730468, -0.300003052, 0.984807491, 1.94707184e-07, 0.173647866, -0.173648044, -2.68220873e-07, 0.984807491, 3.67846468e-07, -0.999999821, -8.00420992e-08),i)
				root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.173648223, 0, -0.98480773, 0, 1, 0, 0.98480773, 0, 0.173648223),i)
				rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.21384871, 0.500000477, -0.879925251, 0.342019856, 0.939692438, -1.49501886e-08, 1.94707184e-07, -2.68220873e-07, -0.999999821, -0.939692438, 0.342020035, -3.76157232e-07),i)
				leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.59201181, 0.470158577, -0.794548988, 0.271118939, 0.181368172, 0.945304275, 0.902039766, -0.390578717, -0.18377316, 0.335885108, 0.902526498, -0.269494623),i)
				lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.681244373, -2.07163191, 0, 0.98480773, 0.173648283, 0, -0.173648283, 0.98480767, 0, 0, -1.86264515e-09, 0.99999994),i)
				righthip.C0 = righthip.C0:lerp(CFrame.new(0.681244612, -2.07163191, -4.76837158e-07, 0.98480773, -0.173648283, 0, 0.173648283, 0.98480767, 0, 0, 1.86264515e-09, 0.99999994),i)
				neck.C0 = neck.C0:lerp(CFrame.new(0.0296957493, 1.49240398, -0.0815882683, 0.336824059, 0.059391167, 0.939692557, -0.173648164, 0.98480773, -7.4505806e-09, -0.925416589, -0.163175896, 0.342020094),i)
				wait()
			end
		end
		for i = 0.2,0.8 , 0.45 do
			if shooting then
				akweld.C0 = akweld.C0:lerp(CFrame.new(-0.109231472, -2.24730468, -0.300003052, 0.984807491, 1.94707184e-07, 0.173647866, -0.173648044, -2.68220873e-07, 0.984807491, 3.67846468e-07, -0.999999821, -8.00420992e-08),i)
				root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.173648223, 0, -0.98480773, 0, 1, 0, 0.98480773, 0, 0.173648223),i)
				rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.60777056, 0.499999523, -0.81046629, 0.342019439, 0.939691842, 1.55550936e-07, 4.10554577e-08, -3.93739697e-07, -0.999999464, -0.939691901, 0.342019975, -4.77612389e-07),i)
				leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.10000956, 0.482372284, -0.926761627, 0.27112025, 0.263066441, 0.925899446, 0.902039289, -0.405109912, -0.149033815, 0.335885197, 0.875603914, -0.347129732),i)
				lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.681244373, -2.07163191, 0, 0.98480773, 0.173648283, 0, -0.173648283, 0.98480767, 0, 0, -1.86264515e-09, 0.99999994),i)
				righthip.C0 = righthip.C0:lerp(CFrame.new(0.681244612, -2.07163191, -4.76837158e-07, 0.98480773, -0.173648283, 0, 0.173648283, 0.98480767, 0, 0, 1.86264515e-09, 0.99999994),i)
				neck.C0 = neck.C0:lerp(CFrame.new(0.121206045, 1.4753027, -0.0450725555, 0.336823881, 0.221664757, 0.915103495, -0.173648164, 0.969846308, -0.171010077, -0.925416648, -0.101305753, 0.365159094),i)
				wait()
			end
		end
	end
end
