Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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)

2 comments

1

RobloxLogic

1

Yeah xD So weird

This discussion is preserved as it was. New answers, comments, and votes are closed.