sp=script.Parent lastattack=0 nextrandom=0 nextsound=0 nextjump=0 chasing=false variance=2 damage=15 attackrange=15 sightrange=200 runspeed=15 wonderspeed=4 healthregen=false function raycast(Q,c,k)local s,i=game.Workspace:FindPartOnRay(Ray.new(Q+c*.01,c*k),sp)if s~=nil and i then if s.Transparency>=.8 or s.Name=="\072\097\110\100\108\101"or string.sub(s.Name,1,6)=="\069\102\102\101\099\116"then local s=k-(i-Q).magnitude return raycast(i,c,s)end end return s,i end function waitForChild(Q,c)local k=Q:findFirstChild(c)if k then return k end while true do k=Q.ChildAdded:wait()if k.Name==c then return k end end end
--Shade Script

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

variance = 2

damage = 15
attackrange = 15
sightrange = 200
runspeed = 15
wonderspeed = 4
healthregen = false

function raycast(spos, vec, currentdist)
	local hit2, pos2 = game.Workspace:FindPartOnRay(Ray.new(spos + (vec * 0.01), vec * currentdist), sp)
	if hit2 ~= nil and pos2 then
		if hit2.Transparency >= 0.8 or hit2.Name == "Handle" or string.sub(hit2.Name, 1, 6) == "Effect" 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
