Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a script that finds a part with a certain color then changes that color automatically?

I have this problem where I have an obby I put a lot of light blue parts but the sky is light blue, so the player can't see the part and I'm too lazy to change all the parts in the obby. Help

2 comments

0

Just select all of the parts and simultaneously in the explorer tab, and change the color.

0

^

2 answers

Use a for loop from the command line to recolor all parts. Remember that you can add for loops inside one another if all of your stages are in a model/folder.

You can just select the parts in explorer but this code should help you too.

while true do
	for _, child in ipairs(workspace:GetChildren()) do
		if child.Color == Color3.new(0,0,0) then -- change the color to the color of the Parts
			child.Color = Color3.new(255,0,0) -- change this to the color you want
		end
	end
end

1 comment

0

+1. This is almost correct: use :GetDescendants() instead of :GetChildren(). This code should be pasted in the command bar (make a backup of your place first!)

This discussion is preserved as it was. New answers, comments, and votes are closed.