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

How would I Change 3 Parts at the same time?

Asked by
woodengop 1134 Moderation Voter
9 years ago

How would I create a Change in 3 or more Parts with the same name? Like for example I have 3 Parts named Childof_Workspace And I want them to change Colors at the same time. Would I have to be using the In Pairs?

Please Respect that I am a Beginner in need of knowledge

1 answer

Log in to vote
0
Answered by
yumtaste 476 Moderation Voter
9 years ago

Yes, you'd have to use pairs(). Here's a little example code:

for i, item in pairs(workspace:GetChildren()) do
if item.Name == "Childof_Workspace" then --there are 3 parts named "Childof_Workspace," so the code below will run 3 times
part.Name = "Childof_YOURMOMLOL"
end
end
0
What is the use of line 3? woodengop 1134 — 9y
2
Just replace that with whatever you want to do to the three bricks. yoshiegg6 176 — 9y
Ad

Answer this question