Position is not a valid member,what?
So I found this script that has global functions in it and I decided to try it out in the output but I got an error saying:
Position is not a valid member
20:44:29.329 - Script 'Workspace.PartTweening', Line 2 - field TweenPosition
20:44:29.329 - Script '_G.TweenPosition(Workspace.Part.Position,Workspace.Part1.CF', Line 1
20:44:29.330 - Stack End
Script with global tables:
01 | _G.TweenPosition = function (part, goal, t) |
02 | local start = part.Position |
03 | local increment = wait() / t |
04 | local x, y, z = part.CFrame:toEulerAnglesXYZ() |
05 | for i = increment, 1 , increment do |
07 | part.CFrame = (CFrame.new(goal,i) + start:Lerp(goal, i)) * CFrame.Angles(x, y, z) |
09 | part.CFrame = (CFrame.new() + goal) * CFrame.Angles(x, y, z) |
12 | _G.TweenAngles = function (part, goal, t) |
13 | local start = Vector 3. new(part.CFrame:toEulerAnglesXYZ()) |
14 | local increment = wait() / t |
15 | for i = increment, 1 , increment do |
17 | local lerped = start:Lerp(goal, i) |
18 | part.CFrame = CFrame.new(part.Position) * CFrame.Angles(lerped.X, lerped.Y, lerped.Z) |
22 | _G.TweenPositionAndAngles = function (part, goalP, goalA, t) |
23 | local startP = part.Position |
24 | local startA = Vector 3. new(part.CFrame:toEulerAnglesXYZ()) |
25 | local increment = wait() / t |
26 | for i = increment, 1 , increment do |
28 | local lerped = startA:Lerp(goalA, i) |
29 | part.CFrame = (CFrame.new() + startP:Lerp(goalP, i)) * CFrame.Angles(lerped.X, lerped.Y, lerped.Z) |
31 | part.CFrame = (CFrame.new() + goalP) * CFrame.Angles(goalA.X, goalA.Y, goalA.Z) |
What I put in the output:
1 | _G.TweenPosition(Workspace.Part.Position,Workspace.Part 1. CFrame, 1 ) |
How would I fix this error in the script it out in the output?