Extremely simple problem, but I somehow coudnt figure it out. Im a beginner scripter.
How come in this code
wait(2)
local Bezier = require(script:WaitForChild("Bezier"))
local TweenService = game:GetService("TweenService")
local Length = nil
local Speed = 30
local Tween = nil
local Goal = nil
--------------------- CURVE 1
local NewBezier1 = Bezier.new(workspace.P1, workspace.P2, workspace.P3)
Length = NewBezier1.Length
local TweenInformation = TweenInfo.new(Length/Speed, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)
Tween = NewBezier1:CreateCFrameTween(script.Parent, {"CFrame"}, TweenInformation)
Tween:Play()
Tween.Completed:Wait()
--------------------- STRAIGHT 1
Length = (workspace.Y1.Position-workspace.Y2.Position).Magnitude
Goal = workspace.Y2.CFrame
TweenInformation = TweenInfo.new(Length/Speed, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)
Tween = TweenService:Create(script.Parent, TweenInformation, Goal)
Tween:Play()
The first tween works fine, but the 2nd one, on line 31, it says unable to cast to dictionary.
Help is appreciated