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

Is there a more efficient way to weld a large number of objects?

Asked by
d3nton 19
2 years ago

Here is an example

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(chr)

        local Armor = game.ServerStorage.D_Armor

        local UpperTorsoArmor = Armor.UpperTorsoArmor

        local UpperLeftArmArmor = Armor.UpperLeftArmArmor
        local LowerLeftArmArmor = Armor.LowerLeftArmArmor

        local UpperRightArmArmor = Armor.UpperRightArmArmor
        local LowerRightArmArmor = Armor.LowerRightArmArmor

        local UpperLeftLegArmor = Armor.UpperLeftLegArmor
        local LowerLeftLegArmor = Armor.LowerLeftLegArmor

        local UpperRightLegArmor = Armor.UpperRightLegArmor
        local LowerRightLegArmor = Armor.LowerRightLegArmor


        local wld = Instance.new("Motor6D", chr.UpperTorso)
        wld.Part1 = UpperTorsoArmor
        wld.Part0 = chr.UpperTorso

        wld.C1 = CFrame.new(1,1.25,0.75):Inverse()

        local wld = Instance.new("Motor6D", chr.LeftUpperArm)
        wld.Part1 = UpperLeftArmArmor
        wld.Part0 = chr.LeftUpperArm

        wld.C1 = CFrame.new(2,0,0.5):Inverse()

        local wld = Instance.new("Motor6D", chr.LowerLeftArmArmor)
        wld.Part1 = LowerLeftArmArmor
        wld.Part0 = chr.LeftLowerArm

        wld.C1 = CFrame.new(0,0.25,0.5):Inverse()

    end)
end)

As you can see the code is very repetitive and I didn't finish the entire thing cause it was giving me a headache.

0
why dont you just parent the qperfectionweld to the model, it will auto weld all the parts greatneil80 2647 — 2y

Answer this question