for i,v in pairs(workspace:GetChildren()) do
	if v.Name == "StarterCharacter" then
		for i,c in pairs(v:GetChildren()) do
			if c.Name == "Torso" then
					local char = c.Parent
					local lh = Instance.new("Motor6D", c)
					lh.Name = "Left Hip"
					local rh = Instance.new("Motor6D", c)
					rh.Name = "Right Hip"
					local ls = Instance.new("Motor6D", c)
					ls.Name = "Left Shoulder"
					local rs = Instance.new("Motor6D", c)
					rs.Name = "Right Shoulder"
					local n = Instance.new("Motor6D", c)
					n.Name = "Neck"
					lh.Part0 = char["Torso"]
					lh.Part1 = char["Left Leg"]
					rh.Part0 = char["Torso"]
					rh.Part1 = char["Right Leg"]
					ls.Part0 = char["Torso"]
					ls.Part1 = char["Left Arm"]
					rs.Part0 = char["Torso"]
					rs.Part1 = char["Right Arm"]
					n.Part0 = char["Torso"]
					n.Part1 = char["Head"]
			end
		end
	end
end

All the body parts go into the centre of the torso when I put this into the command bar. No errors show up in the output. This does it to about 50 or so characters. It works when I do it manually to one character, so I'm not sure why it doesn't work like this. Is it possible to do it with a script?

6 comments

0

Th parent argument to Instance.new is deprecated, assign the parent as the last property.

0

So instead of ", c)" do "lh.Parent = c"?

0

That still did the same thing.

0

But the parent argument is deprecated and should not be used in new work. Parenting an object first before any properties can cause lag, and for this reason you should parent objects last.

0

This is happening because you haven't set the C1 and C0 properties, which defines how the Motor6D offsets the Part0 and Part1 from each other.

0

What? I set the C0 to Torso and C1 to a body part.