Attempt:

local pos = mouse.Target.Parent.Head
int.Interpolate(cam,pos.CFrame*CFrame.new(0,0,2), CFrame.new(0,0,0), "InOut", "Quart", 1) 

--int is a module i listed the module script just in case and i didn't show the var for the require of the module

Module:


local cam = {}

local EasingStyles = {
	linear = function(i, n, EasingDirection)
		return i/n
	end,
	quad = function(i, n, EasingDirection)
		if EasingDirection:lower()=="in"then
			local t=i/n
			return t^2
		elseif EasingDirection:lower()=="out"then
			local t=i/n
			return -1*t*(t-2)
		elseif EasingDirection:lower()=="inout"then
			local t=i/(n/2)
			return t<1 and 1/2*t*t or -1/2*((t-1)*(t-3)-1)			
		end
	end,
	cube = function(i, n, EasingDirection)
		if EasingDirection:lower()=="in"then
			local t=i/n
			return t^3
		elseif EasingDirection:lower()=="out"then
			local t=i/n-1
			return t^3+1
		elseif EasingDirection:lower()=="inout"then
			local t=i/(n/2)
			return t<1 and 1/2*t^3 or 1/2*((t-2)^3+2)
		end
	end,
	quart = function(i, n, EasingDirection)
		if EasingDirection:lower()=="in" then
			local t=i/n
			return t^4
		elseif EasingDirection:lower()=="out"then
			local t=i/n-1
			return -1*(t^4-1)
		elseif EasingDirection:lower()=="inout"then
			local t=i/(n/2)
			return t<1 and 1/2*t^4 or -1/2*((t-2)^4-2)
		end
	end,
	quint = function(i, n, EasingDirection)
		if EasingDirection:lower()=="in" then
			local t=i/n
			return t^5
		elseif EasingDirection:lower()=="out"then
			local t=i/n-1
			return t^5+1
		elseif EasingDirection:lower()=="inout"then
			local t=i/(n/2)
			return t<1 and 1/2*t^5 or 1/2*((t-2)^5+2)
		end
	end,
	sin = function(i, n, EasingDirection)
		if EasingDirection:lower()=="in" then
			return -1*math.cos(i/n*(math.pi/2))+1
		elseif EasingDirection:lower()=="out"then
			return math.sin(i/n*(math.pi/2))
		elseif EasingDirection:lower()=="inout"then
			return -1/2*(math.cos(math.pi*i/n)-1)
		end
	end,
	exp = function(i, n, EasingDirection)
		if EasingDirection:lower()=="in" then
			return math.pow(2,10*(i/n-1))
		elseif EasingDirection:lower()=="out"then
			return -math.pow(2,-10*i/n)+1
		elseif EasingDirection:lower()=="inout"then
			local t=i/(n/2)
			return t<1 and 1/2*math.pow(2,10*(t-1)) or 1/2*(-math.pow(2,-10*(t-1))+2)
		end
	end,
	circ = function(i, n, EasingDirection)
		if EasingDirection:lower()=="in" then
			local t=i/n
			return -1*(math.sqrt(1-t^2)-1)
		elseif EasingDirection:lower()=="out"then
			local t=i/n-1
			return math.sqrt(1-t^2)
		elseif EasingDirection:lower()=="inout"then
			local t=i/(n/2)
			return t<1 and -1/2*(math.sqrt(1-t^2)-1) or 1/2*(math.sqrt(1-(t-2)^2)+1)
		end
	end,
	elastic = function (i, n, EasingDirection, a, p)
		if EasingDirection:lower()=="in" then
			local t,d,s=i/n,n
			p=p or d*.3
			if t==0 or t==1 then 
				return t
			end
			if not a or a<1 then
				a=1
				s=p/4
			else
				s=p/(2*math.pi)*math.asin(1/a)
			end
			t=t-1
			return -(a*math.pow(2,10*t)*math.sin((t*d-s)*(2*math.pi)/p))
		elseif EasingDirection:lower()=="out"then
			local t,d,s=i/n,n
			if t==0 or t==1 then 
				return t 
			end
			p=p or d*.3

			if not a or a < 1 then
				a=1
				s=p/4
			else
				s=p/(2*math.pi)*math.asin(1/a)
			end
			return a*math.pow(2,-10*t)*math.sin((t*d-s)*(2*math.pi)/p)+1
		elseif EasingDirection:lower()=="inout"then
			local t,d,s=i,n
			if t==0 then 
				return t 
			end
			t=t/d*2		
			if t==2 then 
				return 1
			end		
			p=p or d*(0.3*1.5)
			a=a or 0
			if not a or a<1 then
				a=1
				s=p/4
			else
				s=p/(2*math.pi)*math.asin(1/a)
			end		
			if t<1 then
				t=t-1
				return -.5*(a*math.pow(2,10*t)*math.sin((t*d-s)*(2*math.pi)/p))
			else
				t=t-1
				return a*math.pow(2,-10*t)*math.sin((t*d-s)*(2*math.pi)/p)*.5+1
			end
		end
	end,
	back = function(i, n, EasingDirection, s)
		s=s or 1.70158
		if EasingDirection:lower()=="in" then
			local t=i/n
			return t^2*((s+1)*t-s)
		elseif EasingDirection:lower()=="out"then
			local t=i/n-1
			return (t^2*((s+1)*t+s)+1)
		elseif EasingDirection:lower()=="inout"then
			s=s*1.525
			local t=i/n*2
			return t<1 and 1/2*(t*t*((s+1)*t-s))or 1/2*((t-2)*(t-2)*((s+1)*(t-2)+s)+2)
		end
	end,
	bounce = function(i, n, EasingDirection)
		local function outBounce(t,b,c,d)
			t=t/d
			if t<1/2.75 then
				return c*(7.5625*t*t)+b
			elseif t<2/2.75 then
				t=t-(1.5/2.75)
				return c*(7.5625*t*t+0.75)+b
			elseif t<2.5/2.75 then
				t=t-(2.25/2.75)
				return c*(7.5625*t*t+0.9375)+b
			else
				t=t-(2.625/2.75)
				return c*(7.5625*t*t+0.984375)+b
			end
		end
		local function inBounce(t,b,c,d)
			return 1-outBounce(d-t,0,1,d)
		end
		
		if EasingDirection:lower()=="in" then
			local t,d=i,n
			return inBounce(t,0,1,d)
		elseif EasingDirection:lower()=="out"then
			local t,b,c,d=i,0,1,n
			return outBounce(t,b,c,d)
		elseif EasingDirection:lower()=="inout"then
			local t,d=i,n
			if t<d/2 then
				return inBounce(t*2,0,1,d)*.5
			else
				return outBounce(t*2-d,0,1,d)*.5+1*.5
			end
		end
	end
}

local rs = game:GetService("RunService")
function cam.Interpolate(cam, endPos, endLook, EasingDirection, EasingStyle, T)
	local s,g,n,a = cam.CFrame,CFrame.new(endPos.p, endLook.p),T/(1/60),0
	for i=1,n+1 do
		cam.CFrame = s:lerp(g, a)
		a=EasingStyles[EasingStyle:lower()](i,n,EasingDirection)
		rs.RenderStepped:wait()
	end
end

return cam

2 comments

0

O)__(O Bye...

0

lol