while sp.Parent~=nil and(Humanoid and(Humanoid.Parent~=nil and(Humanoid.Health>0 and(Torso and(Head and(Torso~=nil and Torso.Parent~=nil))))))do local K,U=wait(.25)humanoids={}populatehumanoids(game.Workspace)closesttarget=nil closestdist=sightrange local E=sp:FindFirstChild("\099\114\101\097\116\111\114")for K,U in ipairs(humanoids)do if U and U.Parent~=nil then if U.Health>0 and U.Parent~=sp then local K=game.Players:GetPlayerFromCharacter(U.Parent)if E==nil or K==nil or E.Value~=K then local K=U.Parent:FindFirstChild("\084\111\114\115\111")if K~=nil then local U=(K.Position-Torso.Position).magnitude if U<closestdist then closestdist=U closesttarget=K end end end end end end if closesttarget~=nil then if not chasing then chasing=true Humanoid.WalkSpeed=runspeed BARKING:Play()end Humanoid:MoveTo(closesttarget.Position+Vector3.new(1,1,1)*(variance*(math.random()*2-1)),closesttarget)if math.random()<.5 then attack(U,closesttarget.Position)end else if chasing then chasing=false Humanoid.WalkSpeed=wonderspeed BARKING:Stop()end if U>nextrandom then nextrandom=(U+3)+math.random()*5 local K=Torso.Position+(Vector3.new(1,1,1)*math.random()-Vector3.new(.5,.5,.5))*40 Humanoid:MoveTo(K,game.Workspace.Terrain)end end if U>nextsound then end if U>nextjump then nextjump=(U+7)+math.random()*5 Humanoid.Jump=true end animate(U)end wait(4)sp:remove()


while sp.Parent~=nil and Humanoid and Humanoid.Parent~=nil and Humanoid.Health>0 and Torso and Head and Torso~=nil and Torso.Parent~=nil do
	local _,time=wait(0.25)--wait(1/3)
	humanoids={}
	populatehumanoids(game.Workspace)
	closesttarget=nil
	closestdist=sightrange
	local creator=sp:FindFirstChild("creator")
	for i,h in ipairs(humanoids) do
		if h and h.Parent~=nil then
			if h.Health>0 and h.Parent~=sp 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
			--playsound(time)
			chasing=true
			Humanoid.WalkSpeed=runspeed
			BARKING:Play()
		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
			Humanoid.WalkSpeed=wonderspeed
			BARKING:Stop()
		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>nextsound then
		--playsound(time)
	end
	if time>nextjump then
		nextjump=time+7+(math.random()*5)
		Humanoid.Jump=true
	end
	animate(time)
end

wait(4)
sp:remove() --Rest In Pizza
