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

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

Asked by 6 years ago

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

Closed as Too Broad by xAtom_ik, climethestair, and Programical

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

Why was this question closed?

2 answers

Log in to vote
1
Answered by
Shematics 117
6 years 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 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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

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

01local part = workspace.Baseplate
02 
03while true do
04    wait(2)
05    local random = math.random(1,3)-- picks a number randomly
06    if random == 1 then
07        part.BrickColor = BrickColor.new("Bright green") -- if random value is 1 then this color will be picked
08    elseif random == 2 then
09        part.BrickColor = BrickColor.new("Really red") -- if random value is 2 then this color will be picked
10    elseif random == 3 then
11        part.BrickColor = BrickColor.new("Neon orange") -- if random value is 3 then this color will be picked
12    end
13end

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)

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.

1local part = workspace.Baseplate
2 
3while true do
4    wait(2)
5    part.BrickColor = BrickColor.Random() -- picks a random color
6end

Hopes this help :)