Still have questions? Join our Discord server and get real time help.
1

# how to make a script that changes my color part? [closed]

Asked by 7 months ago

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

### Closed as Too Broad by NowUndoThatMistake, climethestair, and Programical

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

1
Shematics 143
7 months ago

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()

0
Thanks! BlackCheap 14 — 7mo
0
Answered by 7 months ago
Edited 7 months ago

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 :)