function NpcModule.CalculeWalk(g,p,J,I,w)local k=0 if w==nil then k=1.7 else k=w end local R=math.random(-p,p)local K=math.random(-p,p)if R<p/k and R>=0 then R=p/k elseif R>-p/k and R<0 then R=-p/k end if K<p/k and K>=0 then K=p/k elseif K>-p/k and K<0 then K=-p/k end R=g.PrimaryPart.Position.X+R K=g.PrimaryPart.Position.Z+K if J~=nil or I~=nil then if R<J.X then R=J.X elseif R>I.X then R=I.X end if K<J.Z then K=J.Z elseif K>I.Z then K=I.Z end end local W=Vector3.new(R,NpcModule.RayY(R,K,g),K)return W end
-- Module 4
function NpcModule.CalculeWalk(NPC, Range, MinVector, MaxVector, Minrange)
	local MinRange = 0

	if Minrange == nil then
		MinRange = 1.7
	else
		MinRange = Minrange
	end

	-- Calcules
	local X = math.random(-Range, Range)
	local Z = math.random(-Range, Range)

	if X < (Range / MinRange) and X >= 0 then
		X = Range / MinRange
	elseif X > (-Range / MinRange) and X < 0 then
		X = -Range / MinRange
	end

	if Z < (Range / MinRange) and Z >= 0 then
		Z = Range / MinRange
	elseif Z > (-Range / MinRange) and Z < 0 then
		Z = -Range / MinRange
	end

	X = NPC.PrimaryPart.Position.X + X
	Z = NPC.PrimaryPart.Position.Z + Z

	if MinVector ~= nil or MaxVector ~= nil then
		if X < MinVector.X then
			X = MinVector.X
		elseif X > MaxVector.X then
			X = MaxVector.X
		end

		if Z < MinVector.Z then
			Z = MinVector.Z
		elseif Z > MaxVector.Z then
			Z = MaxVector.Z
		end
	end

	local Pos = Vector3.new(X, NpcModule.RayY(X, Z, NPC), Z)
	return Pos
end
