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

[Renaming Parts Through Script because Im lazy?]

Asked by 10 years ago

Trying to rename every part in sync like "Part1" , "Part2" ...

parts =  script.Parent:GetChildren()
for i=1, #parts +1 do
    parts.Name = "Part" .. i

end

3 answers

Log in to vote
1
Answered by
Muoshuu 580 Moderation Voter
10 years ago
local Num=0
for i,v in pairs(workspace:GetChildren()) do
    if v:IsA("BasePart") and v.Name~="Terrain" then
        Num=Num+1
        v.Name="Part"..Num
    end
end
Ad
Log in to vote
4
Answered by 10 years ago
parts =  game.Workspace:GetChildren()--This get all the Child that are Workspace
for i,v in pairs (parts) do 
v.Name = "Part" .. i
    wait(1)
end
0
If It works then Please accept my answer and if you want me to explain how it work just ask. UserOnly20Characters 890 — 10y
0
Didnt work Timster111 25 — 10y
0
I check it and it worked fine. UserOnly20Characters 890 — 10y
Log in to vote
0
Answered by 6 years ago
game.Workspace.part = game.Workspace.Part1 

part.Name = ("Name")

Just do that for Part2 as well.

Answer this question