function BezierCurve.LinearBezierCurvesLookAt(c,m,V,R,O,L)local Z=Instance.new("\080\097\114\116")Z.Parent=V Z.Transparency=1 Z.Size=Vector3.new(1,1,1)Z.Anchored=true Z.CanCollide=false if typeof(R)~="\086\101\099\116\111\114\051"then R=R.Position end if typeof(O)~="\086\101\099\116\111\114\051"then O=O.Position end for D=0,c,1 do local f=D/c Z.Position=BezierCurve.Lerp(R,O,f)if D==0 then continue else V.CFrame=CFrame.lookAt(V.Position,Z.Position,Vector3.new(0,1,0))*L V.Position=Z.Position end task.wait(1/m)end Debris:AddItem(Z,task.wait())end function BezierCurve.QuadraticBezierCurvesLookAt(c,m,V,R,O,L,Z)local D=Instance.new("\080\097\114\116")D.Parent=V D.Transparency=1 D.Size=Vector3.new(1,1,1)D.Anchored=true D.CanCollide=false if typeof(R)~="\086\101\099\116\111\114\051"then R=R.Position end if typeof(O)~="\086\101\099\116\111\114\051"then O=O.Position end if typeof(L)~="\086\101\099\116\111\114\051"then L=L.Position end for f=0,c,1 do local d=f/c local v=BezierCurve.Lerp(R,O,d)local a=BezierCurve.Lerp(O,L,d)D.Position=BezierCurve.Lerp(v,a,d)if f==0 then continue else V.CFrame=CFrame.lookAt(V.Position,D.Position,Vector3.new(0,1,0))*Z V.Position=D.Position end task.wait(1/m)end Debris:AddItem(D,task.wait())end function BezierCurve.CubicBezierCurvesLookAt(c,m,V,R,O,L,Z,D)local f=Instance.new("\080\097\114\116")f.Parent=V f.Transparency=1 f.Size=Vector3.new(1,1,1)f.Anchored=true f.CanCollide=false if typeof(R)~="\086\101\099\116\111\114\051"then R=R.Position end if typeof(O)~="\086\101\099\116\111\114\051"then O=O.Position end if typeof(L)~="\086\101\099\116\111\114\051"then L=L.Position end if typeof(Z)~="\086\101\099\116\111\114\051"then Z=Z.Position end for d=0,c,1 do local v=d/c local a=BezierCurve.Lerp(R,O,v)local b=BezierCurve.Lerp(O,L,v)local y=BezierCurve.Lerp(L,Z,v)local G=BezierCurve.Lerp(a,b,v)local q=BezierCurve.Lerp(b,y,v)f.Position=BezierCurve.Lerp(G,q,v)if d==0 then continue else V.CFrame=CFrame.lookAt(V.Position,f.Position,Vector3.new(0,1,0))*D V.Position=f.Position end task.wait(1/m)end Debris:AddItem(f,task.wait())end return BezierCurve


function BezierCurve.LinearBezierCurvesLookAt(Frame , FPS , Target , Position1 , Position2 , CFrameOffset)

	local CFramePart = Instance.new("Part")
	CFramePart.Parent = Target
	CFramePart.Transparency = 1
	CFramePart.Size = Vector3.new(1,1,1)
	CFramePart.Anchored = true
	CFramePart.CanCollide = false

	if typeof(Position1) ~= "Vector3" then
		Position1 = Position1.Position
	end

	if typeof(Position2) ~= "Vector3" then
		Position2 = Position2.Position
	end

	for Index = 0 , Frame , 1 do

		local Time = Index / Frame

		CFramePart.Position = BezierCurve.Lerp(Position1 , Position2 , Time)

		if Index == 0 then
			continue
		else

			Target.CFrame = CFrame.lookAt(Target.Position , CFramePart.Position , Vector3.new(0,1,0)) * CFrameOffset
			Target.Position = CFramePart.Position

		end

		task.wait(1 / FPS)

	end

	Debris:AddItem(CFramePart , task.wait())

end

function BezierCurve.QuadraticBezierCurvesLookAt(Frame , FPS , Target , Position1 , Position2 , Position3 , CFrameOffset)


	local CFramePart = Instance.new("Part")
	CFramePart.Parent = Target
	CFramePart.Transparency = 1
	CFramePart.Size = Vector3.new(1,1,1)
	CFramePart.Anchored = true
	CFramePart.CanCollide = false

	if typeof(Position1) ~= "Vector3" then
		Position1 = Position1.Position
	end

	if typeof(Position2) ~= "Vector3" then
		Position2 = Position2.Position
	end

	if typeof(Position3) ~= "Vector3" then
		Position3 = Position3.Position
	end

	for Index = 0 , Frame , 1 do

		local Time = Index / Frame

		local Lerp1 = BezierCurve.Lerp(Position1 , Position2 , Time)
		local Lerp2 = BezierCurve.Lerp(Position2 , Position3 , Time)

		CFramePart.Position = BezierCurve.Lerp(Lerp1 , Lerp2 , Time)

		if Index == 0 then
			continue
		else

			Target.CFrame = CFrame.lookAt(Target.Position , CFramePart.Position , Vector3.new(0,1,0)) * CFrameOffset
			Target.Position = CFramePart.Position

		end

		task.wait(1 / FPS)

	end

	Debris:AddItem(CFramePart , task.wait())

end

function BezierCurve.CubicBezierCurvesLookAt(Frame , FPS , Target , Position1 , Position2 , Position3 , Position4 , CFrameOffset)


	local CFramePart = Instance.new("Part")
	CFramePart.Parent = Target
	CFramePart.Transparency = 1
	CFramePart.Size = Vector3.new(1,1,1)
	CFramePart.Anchored = true
	CFramePart.CanCollide = false

	if typeof(Position1) ~= "Vector3" then
		Position1 = Position1.Position
	end

	if typeof(Position2) ~= "Vector3" then
		Position2 = Position2.Position
	end

	if typeof(Position3) ~= "Vector3" then
		Position3 = Position3.Position
	end

	if typeof(Position4) ~= "Vector3" then
		Position4 = Position4.Position
	end

	for Index = 0 , Frame , 1 do

		local Time = Index / Frame

		local Lerp1 = BezierCurve.Lerp(Position1 , Position2 , Time)
		local Lerp2 = BezierCurve.Lerp(Position2 , Position3 , Time)
		local Lerp3 = BezierCurve.Lerp(Position3 , Position4 , Time)

		local InLerp1 = BezierCurve.Lerp(Lerp1 , Lerp2 , Time)
		local InLerp2 = BezierCurve.Lerp(Lerp2 , Lerp3 , Time)

		CFramePart.Position = BezierCurve.Lerp(InLerp1 , InLerp2 , Time)

		if Index == 0 then
			continue
		else

			Target.CFrame = CFrame.lookAt(Target.Position , CFramePart.Position , Vector3.new(0,1,0)) * CFrameOffset
			Target.Position = CFramePart.Position

		end

		task.wait(1 / FPS)

	end

	Debris:AddItem(CFramePart , task.wait())

end

return BezierCurve
