playAnimation("\105\100\108\101",.1,Humanoid)pose="\083\116\097\110\100\105\110\103"function populatehumanoids(b)if b.ClassName=="\072\117\109\097\110\111\105\100"then table.insert(humanoids,b)end for b,V in ipairs(b:GetChildren())do populatehumanoids(V)end end while Figure.Parent~=nil and(Humanoid and(Humanoid.Parent~=nil and(Humanoid.Health>0 and(Torso and(Figure.Head and(Torso~=nil and Torso.Parent~=nil))))))do local b,V=wait(.1)humanoids={}populatehumanoids(game.Workspace)closesttarget=nil closestdist=sightrange local r=Figure:FindFirstChild("\099\114\101\097\116\111\114")for b,V in ipairs(humanoids)do if V and V.Parent~=nil then if V.Health>0 and(V.Parent.Name~=Figure.Name and V.Parent~=Figure)then local b=game.Players:GetPlayerFromCharacter(V.Parent)if r==nil or b==nil or r.Value~=b then local b=V.Parent:FindFirstChild("\084\111\114\115\111")if b~=nil then local V=(b.Position-Torso.Position).magnitude if V<closestdist then closestdist=V closesttarget=b end end end end end end if closesttarget~=nil then if not chasing then chasing=true Figure.canAttack.Value=true Humanoid.WalkSpeed=runspeed end Humanoid:MoveTo(closesttarget.Position+Vector3.new(1,1,1)*(variance*(math.random()*2-1)),closesttarget)if math.random()<.5 then end else if chasing then chasing=false Figure.canAttack.Value=false Humanoid.WalkSpeed=wonderspeed end if V>nextrandom then nextrandom=(V+3)+math.random()*5 local b=Torso.Position+(Vector3.new(1,1,1)*math.random()-Vector3.new(.5,.5,.5))*40 Humanoid:MoveTo(b,game.Workspace.Terrain)end end if V>nextjump then nextjump=(V+7)+math.random()*5 Humanoid.Jump=true end move(V)end wait(4)Figure:remove()

playAnimation("idle", 0.1, Humanoid)
pose = "Standing"

function populatehumanoids(mdl)
	if mdl.ClassName=="Humanoid" then
		table.insert(humanoids,mdl)
	end
	for i2,mdl2 in ipairs(mdl:GetChildren()) do
		populatehumanoids(mdl2)
	end
end

while Figure.Parent~=nil and Humanoid and Humanoid.Parent~=nil and Humanoid.Health>0 and Torso and Figure.Head and Torso~=nil and Torso.Parent~=nil do
	local _,time=wait(0.1)
	humanoids={}
	populatehumanoids(game.Workspace)
	closesttarget=nil
	closestdist=sightrange
	local creator=Figure:FindFirstChild("creator")
	for i,h in ipairs(humanoids) do
		if h and h.Parent~=nil then
			if h.Health>0 and h.Parent.Name~=Figure.Name and h.Parent~=Figure then
				local plr=game.Players:GetPlayerFromCharacter(h.Parent)
				if creator==nil or plr==nil or creator.Value~=plr then
					local t=h.Parent:FindFirstChild("Torso")
					if t~=nil then
						local dist=(t.Position-Torso.Position).magnitude
						if dist<closestdist then
							closestdist=dist
							closesttarget=t
						end
					end
				end
			end
		end
	end
	if closesttarget~=nil then
		if not chasing then
			chasing=true
			Figure.canAttack.Value=true
			Humanoid.WalkSpeed=runspeed
		end
		Humanoid:MoveTo(closesttarget.Position+(Vector3.new(1,1,1)*(variance*((math.random()*2)-1))),closesttarget)
		if math.random()<.5 then
			--attack(time,closesttarget.Position)
		end
	else
		if chasing then
			chasing=false
			Figure.canAttack.Value=false
			Humanoid.WalkSpeed=wonderspeed
		end
		if time>nextrandom then
			nextrandom=time+3+(math.random()*5)
			local randompos=Torso.Position+((Vector3.new(1,1,1)*math.random()-Vector3.new(.5,.5,.5))*40)
			Humanoid:MoveTo(randompos,game.Workspace.Terrain)
		end
	end
	if time>nextjump then
		nextjump=time+7+(math.random()*5)
		Humanoid.Jump=true
	end
	--animate(time)
	move(time)
end

wait(4)
Figure:remove()
