generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Change Generic Name Part Color

Previous Thread :: Next Thread 
LordMooSnuckel is not online. LordMooSnuckel
Joined: 15 Jun 2014
Total Posts: 58
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
CardboardRocks is not online. CardboardRocks
Joined: 25 Dec 2011
Total Posts: 411
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
LordMooSnuckel is not online. LordMooSnuckel
Joined: 15 Jun 2014
Total Posts: 58
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
CardboardRocks is not online. CardboardRocks
Joined: 25 Dec 2011
Total Posts: 411
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image