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

How do I set this to make the car always black instead of a random color?

local color = BrickColor.new(math.random(), math.random(), math.random())
for _,i in pairs (script.Parent.Parent:GetChildren()) do
	if i.Name == "Color" then
		i.BrickColor = color
	end
end

4 comments

0

To make a part black, just use i.BrickColor = BrickColor.new(0, 0, 0)

0

Colour = BrickColor.Black()

0

@GarrettlovesGTA, learn about the basics of scripting before making a request, THERE'S plenty of resources out there, e.g.YouTube etc.

0

And also, don't just dive into the complexities make sure you fully understand the basics and advanced sections of coding!

1 answer

✓ Accepted answer

You can reference specific colors using the color's name found on the palette given to you in the properties menu. For this, you would just do BrickColor.new("Black") or BrickColor.new("Really Black")

local color = BrickColor.new("Black") --just reference the color name found on the palette

for _,i in pairs (script.Parent.Parent:GetChildren()) do
    if i.Name == "Color" then
        i.BrickColor = color
    end
end

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