I was making a CFrame animation thing using tables but the I had trouble adding CFrame values in the table. how would add these CFrame values inside the table?
Output:
line 27: '}' expected (to close '{' at line 26) near '='
Player = game.Players.LocalPlayer Character = Player.Character Torso = Character.Torso Mouse = Player:GetMouse() Tween = require(game.Workspace.Transition) 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 Weld = MakeWelds() Equip = { Weld[1].C0 = CFrame.new(1.1,0.3,-0.5)*CFrame.Angles(0.5,2.5,1),---LeftArm Weld[2].C0 = CFrame.new(-1.1,0.3,-0.5)*CFrame.Angles(0.5,-2.5,-1)---RightArm } ----------------------------------------
Other Questions:
. Would I need separate tables to move left an right arm or will it work for both?If so how?
You cannot change properties within a table. Try this
Equip = {} Equip.Weld = MakeWelds() -- Adds the Weld table to the Equip table -- Instead of Line 24 to Line 29.
Then you can do something like this
Equip.Weld[1].C0 = CFrame.new(1.1,0.3,-0.5)*CFrame.Angles(0.5,2.5,1) Equip.Weld[2].C0 = CFrame.new(-1.1,0.3,-0.5)*CFrame.Angles(0.5,-2.5,-1)
And for your second question, you won't need seperate tables for this. If you want to add the CFrame values to a table then you do:
Equip = {} Equip.Weld = {} Equip.Weld[1] = CFrame.new(1.1,0.3,-0.5)*CFrame.Angles(0.5,2.5,1) Equip.Weld[2] = CFrame.new(-1.1,0.3,-0.5)*CFrame.Angles(0.5,-2.5,-1)