I'm trying to make a script where it will automatically rename my Rig's joints. This is what I've tried and it doesn't work. Elk is my rig in my workspace (it is a model), and it has a part named Torso in it.
Rig = workspace.Elk Torso = workspace.Elk.Torso:GetChildren() for i, v in pairs(Torso) do if v.Part1 == ("Right Arm") then v.Name = ("Right Shoulder") end end
Rig = workspace.Elk Torso = workspace.Elk.Torso:GetChildren() for i,v in pairs(Torso) do if v.Part1.Name == "Right Arm" then v.Name = "Right Shoulder" end end
You were trying to check if a part was equal to a string value. This script will loop through the Torso checking if any Motors have a Part1 named "Right Arm". I hope this will help you out!