sp=script.Parent lastattack=0 nextrandom=0 nextsound=0 nextjump=0 chasing=false variance=4 damage=10 attackrange=4.5 sightrange=999 runspeed=16 wonderspeed=8 healthregen=false colors={"\083\097\110\100 \114\101\100","\068\117\115\116\121 \082\111\115\101";"\077\101\100\105\117\109 \098\108\117\101";"\083\097\110\100 \098\108\117\101","\076\097\118\101\110\100\101\114";"\069\097\114\116\104 \103\114\101\101\110","\066\114\111\119\110";"\077\101\100\105\117\109 \115\116\111\110\101 \103\114\101\121","\066\114\105\099\107 \121\101\108\108\111\119"}function raycast(q,U,Q)local T,R=game.Workspace:FindPartOnRay(Ray.new(q+U*.01,U*Q),script.Parent)if T~=nil and R then if T.Parent==script.Parent and T.Transparency>=.8 or T.Name=="\072\097\110\100\108\101"or string.sub(T.Name,1,6)=="\069\102\102\101\099\116"or T.Parent:IsA("\072\097\116")or T.Parent:IsA("\084\111\111\108")or T.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")and(T.Parent:FindFirstChild("\084\069\065\077")and(T.Parent:FindFirstChild("\084\069\065\077")).Value==script.Parent.TEAM.Value)or not T.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")and T.CanCollide==false then local T=Q-(R-q).magnitude return raycast(R,U,T)end end return T,R end function waitForChild(q,U)local Q=q:findFirstChild(U)if Q then return Q end while true do Q=q.ChildAdded:wait()if Q.Name==U then return Q end end end
--Zombie artificial stupidity script

sp = script.Parent
lastattack = 0
nextrandom = 0
nextsound = 0
nextjump = 0
chasing = false

variance = 4

damage = 10
attackrange = 4.5
sightrange = 999 --60
runspeed = 16
wonderspeed = 8
healthregen = false
colors = {
	"Sand red",
	"Dusty Rose",
	"Medium blue",
	"Sand blue",
	"Lavender",
	"Earth green",
	"Brown",
	"Medium stone grey",
	"Brick yellow",
}

function raycast(spos, vec, currentdist)
	local hit2, pos2 = game.Workspace:FindPartOnRay(Ray.new(spos + (vec * 0.01), vec * currentdist), script.Parent)
	if hit2 ~= nil and pos2 then
		if
			hit2.Parent == script.Parent and hit2.Transparency >= 0.8
			or hit2.Name == "Handle"
			or string.sub(hit2.Name, 1, 6) == "Effect"
			or hit2.Parent:IsA("Hat")
			or hit2.Parent:IsA("Tool")
			or (hit2.Parent:FindFirstChild("Humanoid") and hit2.Parent:FindFirstChild("TEAM") and hit2.Parent:FindFirstChild(
				"TEAM"
			).Value == script.Parent.TEAM.Value)
			or (not hit2.Parent:FindFirstChild("Humanoid") and hit2.CanCollide == false)
		then
			local currentdist = currentdist - (pos2 - spos).magnitude
			return raycast(pos2, vec, currentdist)
		end
	end
	return hit2, pos2
end

function waitForChild(parent, childName)
	local child = parent:findFirstChild(childName)
	if child then
		return child
	end
	while true do
		child = parent.ChildAdded:wait()
		if child.Name == childName then
			return child
		end
	end
end
