I'm trying to rename 13 motors so that I can further script them to make a custom character. How would I change the names one by one, descending the list of children?
local Body = script.Parent Body.PrimaryPart = Body.HumanoidRootPart for i=1, 13 do local M = Instance.new("Motor6D") M.Parent = Body.Chest end local Z = Body.Chest:GetChildren()
To give each motor a unique name, you must do this:
local Body = script.Parent Body.PrimaryPart = Body.HumanoidRootPart for i=1, 13 do local M = Instance.new("Motor6D") M.Parent = Body.Chest M.Name = "Motor" .. i -- 'i' gets the number of loops end local Z = Body.Chest:GetChildren()
This script will return a Motor named Motor then whatever id in the loop it is.
For example on the sixth loop, the Motor will be named "Motor6"
Sincerely,
jmanrock123
P.S. I HOPE THIS HELPED <3