Le module in question:
local BezierCurve = {}
function BezierCurve.Linear(Percent,P0,P1,Ins,Property)
local t = Percent/100
t = t >= 1 and 1 or t
if P0 and P1 then
if Ins and Ins[Property] then
if Property == "CFrame" then
local P0 = P0.p
local P1 = P1.p
Ins[Property] = CFrame.new(P0 + t * (P1-P0))
else
Ins[Property] = P0 + t * (P1-P0)
end
else
return P0 + t * (P1-P0)
end
end
end
function BezierCurve.Quadratic(Percent,P0,P1,P2,Ins,Property)
local t = Percent/100
t = t >= 1 and 1 or t
if P0 and P1 and P2 then
if Ins and Ins[Property] then
if Property == "CFrame" then
local P0 = P0.p
local P1 = P1.p
local P2 = P2.p
Ins[Property] = CFrame.new((1-t)^2 * P0 + 2 * (1-t) * t * P1 + t^2 * P2)
else
Ins[Property] = (1-t)^2 * P0 + 2 * (1-t) * t * P1 + t^2 * P2
end
else
return (1-t)^2 * P0 + 2 * (1-t) * t * P1 + t^2 * P2
end
end
end
function BezierCurve.Cubic(Percent,P0,P1,P2,P3,Ins,Property)
local t = Percent/100
t = t >= 1 and 1 or t
if P0 and P1 and P2 and P3 then
if Ins and Ins[Property] then
if Property == "CFrame" then
local P0 = P0.p
local P1 = P1.p
local P2 = P2.p
local P3 = P3.p
Ins[Property] = CFrame.new((1-t)^3 * P0 + 3 * (1-t)^2 * t * P1 + 3 * (1-t) * t^2 * P2 + t^3 * P3)
else
Ins[Property] = (1-t)^3 * P0 + 3 * (1-t)^2 * t * P1 + 3 * (1-t) * t^2 * P2 + t^3 * P3
end
else
return (1-t)^3 * P0 + 3 * (1-t)^2 * t * P1 + 3 * (1-t) * t^2 * P2 + t^3 * P3
end
end
end
function BezierCurve.Interp(Method,StartPercent,DesiredPercent,Duration,Callback,...)
local Start = tick()
local EndTime = Start + Duration
local PercentDif = DesiredPercent - StartPercent
while tick() < EndTime do
wait()
local NewPercent = StartPercent + PercentDif * ((tick()-Start)/Duration)
if Method == "Linear" then
BezierCurve.Linear(NewPercent,...)
elseif Method == "Quadratic" then
BezierCurve.Quadratic(NewPercent,...)
elseif Method == "Cubic" then
BezierCurve.Cubic(NewPercent,...)
end
end
if Callback then
Callback()
end
end
return BezierCurve
When require()'d and I attempt to use BezierCurve.Interp() from any other script, it returns the error 'Interp is not a valid member of ModuleScript'. Have I just missed something with syntax and I'm too fried to tell? Example:
BezierCurves.Interp("Quadratic", 0, 100, 2, 0, P1, P2, P3, Grenade, "CFrame")

2 comments
Please edit your question to also include where you define the variable BezierCurves, because your problem lies in your usage, not in the actual module.
Where you define it in a normal script*