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

Welding parts to a Player when their character is added will not work?

Asked by 9 years ago

My problem is no weld is made so the part end up falling off the map, gone.

The script isn't fully made yet, I stopped to test and noticed it wasn't working properly. This is a Script, here is my code:

ArmCover1 = game.ServerStorage.ArmCover1
ArmCover2 =  game.ServerStorage.ArmCover2
LegCover1 =  game.ServerStorage.LegCover1
LegCover2 =  game.ServerStorage.LegCover2
TorsoCover =  game.ServerStorage.TorsoCover
HeadCover =  game.ServerStorage.HeadCover

game.Players.PlayerAdded:connect(function(Plr)
    Plr.CharacterAdded:connect(function(Char)

        local Copy = ArmCover1:Clone()
        Copy.Parent = game.Workspace
        Copy.Anchored = false
        local w = Instance.new("Weld",Copy)
        w.Part0 = Copy
        w.Part1 = Char["Left Arm"]
        w.C0 = CFrame.new(0 ,0 ,0)

        local Copy2 = ArmCover2:Clone()
        Copy2.Parent = game.Workspace
        Copy2.Anchored = false
        local w2 = Instance.new("Weld", Copy2)
        w2.Part0 = Copy2
        w2.Part1 = Char["Right Arm"]
        w2.C0 = CFrame.new(0 ,0 ,0)

        local Copy3 = LegCover1:Clone()
        Copy3.Parent = game.Workspace
        Copy3.Anchored = false
        local w3 = Instance.new("Weld", Copy3)
        w3.Part0 = Copy3
        w3.Part1 = Char["Left Leg"]
        w3.C0 = CFrame.new(0 ,0 ,0)

        local w4 = Instance.new("Weld", LegCover2)

        local w5 = Instance.new("Weld", TorsoCover)

        local w6 = Instance.new("Weld", HeadCover)

    end)
end)

The names of the parts should be self explanatory?

1 answer

Log in to vote
1
Answered by 9 years ago

Here your error is You only forgot to put spawn(function()) end) I don't know why, its really weird. But Nevermind you can also try this o.o.

ArmCover1 = game.ServerStorage.ArmCover1
ArmCover2 =  game.ServerStorage.ArmCover2
LegCover1 =  game.ServerStorage.LegCover1
LegCover2 =  game.ServerStorage.LegCover2
TorsoCover =  game.ServerStorage.TorsoCover
HeadCover =  game.ServerStorage.HeadCover

game.Players.PlayerAdded:connect(function(Plr)
    Plr.CharacterAdded:connect(function(Char)
    spawn(function()

       local Copy = ArmCover1:Clone()
      Copy.Parent = Char    
         Copy.Anchored = false
         local w = Instance.new("Weld",Copy)
         w.Part0 = Copy
         w.Part1 = Char["Left Arm"]
        w.C0 = CFrame.new(0 ,0 ,0)

        local Copy2 = ArmCover2:Clone()
        Copy2.Parent = Char
        Copy2.Anchored = false
        local w2 = Instance.new("Weld", Copy2)
        w2.Part0 = Copy2
        w2.Part1 = Char["Right Arm"]
        w2.C0 = CFrame.new(0 ,0 ,0)

        local Copy3 = LegCover1:Clone()
        Copy3.Parent = Char
        Copy3.Anchored = false
        local w3 = Instance.new("Weld", Copy3)
        w3.Part0 = Copy3
        w3.Part1 = Char["Left Leg"]
        w3.C0 = CFrame.new(0 ,0 ,0)

        local w4 = Instance.new("Weld", LegCover2)

        local w5 = Instance.new("Weld", TorsoCover)

        local w6 = Instance.new("Weld", HeadCover)
end)

    end)
end)
1
RobloxLogic alphawolvess 1784 — 9y
1
Yeah xD So weird XToonLinkX123 580 — 9y
Ad

Answer this question