function TweenToPoint(destination, car)
if Tycoon.PurchasedObjects:FindFirstChild(car) then
local newCar = Tycoon.PurchasedObjects[car]
local primary = newCar:FindFirstChild("Primary") or newCar.PrimaryPart
local speed = (primary.CFrame - destination.CFrame).Magnitude -- Error Here
local info = TweenInfo.new(speed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)
local props = {CFrame = destination.CFrame}
local tween = TS:Create(primary, info, props)
tween:Play()
tween.Completed:Wait()
end
end
This is the function
, (it gets called later in the script), and the output always says this: "invalid argument #2 (Vector3 expected, got CFrame)"
, and I can only imagine it’s because the “things” don’t exist, but they do.
Any help is appreciated, (also it’s very little info so i can say more if you want me to)