Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How could you convert a number into Vector3 value?

Asked by 9 years ago

I was making a function called "SmoothCFrame" which basically tweens the part with the coordinates given,but I got this error saying:

Players.Player1.PlayerGui.LocalScript:27: bad argument #1 to 'new' (Vector3 expected, got number)

How do I fix it?

Player = game.Players.LocalPlayer
Character = Player.Character
Torso = Character.Torso
Mouse = Player:GetMouse()
    if not Character or Character.Parent == nil then
    Character = Player.CharacterAdded:wait()
    end
-----------------------------------------
function MakeWelds()
    local Arms = {Character["Left Arm"],
                  Character["Right Arm"]
    }
    local ArmWelds = {}
    for i,v in pairs (Arms) do
        local Weld = Instance.new("Weld",Torso)
        Weld.Name = v.Name.." Weld"
        Weld.Part0 = Torso
        Weld.Part1 = v
        ArmWelds[i] = Weld
    end
    return ArmWelds
end
Welds = MakeWelds()
function SmoothCFrame (Weld,Value,Value2)--Tween thingy
    for Tween = 0.1,Value do
    for Tween = 0.1,Value2 do
    Welds[Weld].C0 = CFrame.new(Value)*CFrame.Angles(Value2)
    end
    end
end
SmoothCFrame(1,1.1,0.3,-0.5,0.5,2.5,1)
--Welds[1].C0 = CFrame.new(1.1,0.3,-0.5)*CFrame.Angles(0.5,2.5,1)
--Welds[2].C0 = CFrame.new(-1.1,0.3,-0.5)*CFrame.Angles(0.5,-2.5,-1)
----------------------------------------

Answer this question