How do I make a dance floor with specific colours? Here's my attempt:
01 | local colours = { |
02 | "Really blue" , |
03 | "Deep orange" , |
04 | "New Yeller" , |
05 | "Bright green" , |
06 | "Really blue" , |
07 | "Cyan" , |
08 | "Carnation pink" , |
09 | "Eggplant" , |
10 | "White" |
11 | } |
12 |
13 | local randomColour = math.random( 1 ,#colours) |
14 | local Parts = game.Workspace.GameParts.unsafeParts:GetChildren() |
15 |
Edited mines*
01 | local Parts = game.Workspace.GameParts.unsafeParts:GetChildren() |
02 | local Colors = { |
03 | "Really red" , |
04 | "Bright yellow" , |
05 | "Bright blue" |
06 | } |
07 |
08 | while wait( 4 ) do -- You can also do this for waiting |
09 | for i,v in pairs (Parts) do |
10 | if v:IsA( "Part" ) then |
11 | local Num = math.random( 1 , #Colors) -- Get a random number between 1 and the number of strings in colors |
12 | v.BrickColor = BrickColor.new(Colors [ Num ] ) -- So if Num == 2, then it would change to bright yellow |
13 | end |
14 | end |
15 | end |
Hope this helps!
Alternatively, you could do this:
01 | local colors = { |
02 | BrickColor.new( "Tawny" ), |
03 | BrickColor.new( "Toothpaste" ), |
04 | BrickColor.new( "Teal" ), |
05 | BrickColor.new( "Terra Cotta" ), |
06 | BrickColor.new( "Steel blue" ), |
07 | } |
08 |
09 | local randomcolor = colors [ math.random( 1 ,#colors) ] |
10 |
11 | local part = game.Workspace.Part |
12 | part.BrickColor = randomcolor |
13 |
14 | local Parts = game.Workspace.GameParts.unsafeParts:GetChildren() |
15 |