local g={}local G do local g=(CFrame.new()).pointToObjectSpace function G(G,F,C)local a=g(G,C)local N,u,o=F.x/2,F.y/2,F.z/2 local f,R,l=a.x,a.y,a.z return f*f<N*N and(f*f<N*N and f*f<N*N)end end local F do local g=(CFrame.new()).pointToObjectSpace function F(G,F,C,a)local N=g(G,C)local u,o,f=F.x/2,F.y/2,F.z/2 local R,l,n=N.x,N.y,N.z local s=R>u and R-u or R<-u and R+u or 0 local y=l>o and l-o or l<-o and l+o or 0 local c=n>f and n-f or n<-f and n+f or 0 return(s*s+y*y)+c*c<a*a end end


local Region={}



local BoxPointCollision do
	local VecDiv=CFrame.new().pointToObjectSpace--Right Division, yo.
	function BoxPointCollision(CFrame,Size,Point)
		local Relative	=VecDiv(CFrame,Point)
		local sx,sy,sz	=Size.x/2,Size.y/2,Size.z/2
		local rx,ry,rz	=Relative.x,Relative.y,Relative.z
		return			rx*rx<sx*sx and rx*rx<sx*sx and rx*rx<sx*sx
	end
end



local BoxSphereCollision do
	local VecDiv=CFrame.new().pointToObjectSpace--Right Division, yo.
	function BoxSphereCollision(CFrame,Size,Center,Radius)
		local Relative	=VecDiv(CFrame,Center)
		local sx,sy,sz	=Size.x/2,Size.y/2,Size.z/2
		local rx,ry,rz	=Relative.x,Relative.y,Relative.z
		local dx		=rx>sx and rx-sx--Faster than if statement
						or rx<-sx and rx+sx
						or 0
		local dy		=ry>sy and ry-sy
						or ry<-sy and ry+sy
						or 0
		local dz		=rz>sz and rz-sz
						or rz<-sz and rz+sz
						or 0
		return dx*dx+dy*dy+dz*dz<Radius*Radius
	end
end


