01 | local tweeninfo = TweenInfo.new( 8 ,Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0 , false , 0 ) |
02 | local vectorlookat = Instance.new( "Vector3Value" , script.Parent) |
03 | vectorlookat.Value = goal |
04 | local vectorvalue = Instance.new( "Vector3Value" , script.Parent) |
05 | vectorvalue.Value = script.Parent.Position |
06 | local tween = ts:Create(vectorvalue, tweeninfo, { Value = goal } ) |
07 | tween:Play() |
08 | vectorvalue.Changed:Connect( function () |
09 | if (script.Parent.Position - goal).magnitude > 1 then -- Error here |
10 | local position = vectorvalue.Value |
11 | script.Parent.Parent:SetPrimaryPartCFrame(CFrame.new(position, vectorlookat.Value)) |
12 | end |
13 | end ) |
14 | tween.Completed:Wait() |
15 | vectorlookat:Destroy() |
16 | vectorvalue:Destroy() |
17 |
18 | print ( "Moving tween sucess!" ) |
Help plz