Jakeup10
|
  |
| Joined: 29 Nov 2008 |
| Total Posts: 6782 |
|
|
| 28 Nov 2013 03:34 PM |
local colors = {"Bright blue","Bright bluish green","Medium blue","Pastel Blue","Pastel light blue","Deep blue","Navy blue"}
local Ice = Workspace.IceSection:GetChildren()
for i = 1, #Ice do
script.Parent.IceSection.Ice.BrickColor = BrickColor.new(colors[math.random(1,#colors)])
wait(1) end
I am trying to get a simple script to randomize and change the color of all the parts in a model, for now and future use, but the only part which changed color was one part in the model, over and over. Did I do something wrong? I think it has to do with script.Parent.IceSection.Ice.BrickColor = BrickColor.new, due to how it chose that part, but I'm not sure...Any ideas? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 28 Nov 2013 03:40 PM |
Same thing happened to me. Here's the fix:
randombrickcolor = BrickColor.new(colors[math.random(1,#colors)]) inside = script.Parent:GetChildren()
for=1,#inside do if inside[i]:IsA("Part") then inside[i]BrickColor = randombrickcolor
wait (1) end end |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2013 03:40 PM |
Try this and see if this is what you want
local colors = {"Bright blue","Bright bluish green","Medium blue","Pastel Blue","Pastel light blue","Deep blue","Navy blue"}
local Ice = Workspace.IceSection:GetChildren()
for i = 1, #Ice do
Ice[i].BrickColor = BrickColor.new(colors[math.random(1,#colors)])
wait(1) end
Masked in sight [Nowhere to be found] |
|
|
| Report Abuse |
|
|
Jakeup10
|
  |
| Joined: 29 Nov 2008 |
| Total Posts: 6782 |
|
|
| 28 Nov 2013 03:45 PM |
Yes andrew, that did exactly what I needed! I see how it works now, Ice specifies which part it is as it goes through the parts! This has helped me randomize the colors of ice, but now I shall modify it to color this crazy 20,000 part thing...Thanks! www.roblox.com/Roblox-Stress-Test-place?id=122968277
|
|
|
| Report Abuse |
|
|