|
| 16 Jan 2015 08:51 PM |
I have a model and inside that model is a bunch of parts that have the same name "Leaves" I want it so that the leaves will change color All at the same time and will change by "wait(1)" How do I select them all and change the color.
Please just reply with a script that I can put into the model and it will select all the "Leaves" and Just use "--Explanation" For a short Explanation of what each does. Thank you! |
|
|
| Report Abuse |
|
|
|
| 16 Jan 2015 08:56 PM |
This is not a request place, but i'd be glad to get you started.
colors = { 'ColorName1', 'ColorName2' }
while wait(1) do for i, v in pairs (script.Parent:GetChildren()) do if v:IsA('Script') then -- checks if it's a script or not else v.BrickColor3 = BrickColor.new(colors[math.random1, #colors]) end end end |
|
|
| Report Abuse |
|
|
|
| 16 Jan 2015 09:27 PM |
It gets a error on the comma.
colors = { 'Hot pink', 'Blue' }
while wait(1) do for i, v in pairs (script.Parent:GetChildren()) do if v:IsA('Script') then -- checks if it's a script or not else v.BrickColor3 = BrickColor.new(colors[math.random1, #colors]) end end Right ^^^ There end
|
|
|
| Report Abuse |
|
|
|
| 17 Jan 2015 01:16 PM |
My bad, it's supposed to be BrickColor.new(colors[math.random(1, #colors)])
Try that |
|
|
| Report Abuse |
|
|
goro7
|
  |
| Joined: 01 Jul 2009 |
| Total Posts: 735 |
|
|
| 17 Jan 2015 01:19 PM |
You know instead of if ... then [BLANK] else ... end, you could just do if not ... then ... end, right?
( ͡° ͜ʖ ͡°) |
|
|
| Report Abuse |
|
|