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 changes my color part?

I want my part change color every 2 minutes like green,red,orange. thanks!

2 answers

You can use "Instance.NewPart" for a new part but if you have already got a part

Insert a script inside that part and write: while wait() do script.Parents.BrickColor = BrickColor.Random() wait(0.1) script.Parents.BrickColor = BrickColor.Random()

1 comment

0

Thanks!

I'm assuming "Part"' is a Baseplate.

Insert a script into the workspace and type in this code.

local part = workspace.Baseplate

while true do
	wait(2)
	local random = math.random(1,3)-- picks a number randomly
	if random == 1 then
		part.BrickColor = BrickColor.new("Bright green") -- if random value is 1 then this color will be picked
	elseif random == 2 then
		part.BrickColor = BrickColor.new("Really red") -- if random value is 2 then this color will be picked
	elseif random == 3 then
		part.BrickColor = BrickColor.new("Neon orange") -- if random value is 3 then this color will be picked
	end
end

And I'm also assuming you only one these 3 colors only, else if u want more, u can add more in more just by copying and pasting. (Only use this if you want specific colors)

								**OR**

If you want a lot of colors then, don't use the method above as it takes time to type out the individual colors and by a lot of colors, I mean all the colors in the Roblox studio color. Then, type this code.

local part = workspace.Baseplate

while true do
	wait(2)
	part.BrickColor = BrickColor.Random() -- picks a random color 
end

Hopes this help :)

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