|
| 29 Jul 2012 04:33 PM |
| I want to make a script that changes any part that is Magenta to Bright red, so I don't have to do it all manually. Would anybody be able to help me with this? |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 04:35 PM |
function color(location, color1, color2) for i, v in pairs(location:GetChildren()) do if v:IsA("BasePart") and v.BrickColor == BrickColor.new(color1) then v.BrickColor = BrickColor.new(color2) end end end
color(Workspace, "Magenta", Bright red")
† KMXD † - Evil Duck Overlord, bent on world domination. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 04:36 PM |
| Thank you very much. Do I put that into the model with the magenta parts, and then just click play? |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 04:36 PM |
function color(location, color1, color2) for i, v in pairs(location:GetChildren()) do if v:IsA("BasePart") and v.BrickColor == BrickColor.new(color1) then v.BrickColor = BrickColor.new(color2) end end end color(Workspace, "Magenta", "Bright red")
† KMXD † - Evil Duck Overlord, bent on world domination. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 04:37 PM |
No, just change "Workspace" to the location of the magenta parts, you can put the script in Workspace.
† KMXD † - Evil Duck Overlord, bent on world domination. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 04:40 PM |
| It didn't work, but thank you for trying anyway :) |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 04:41 PM |
Did you try the second one? And what was the new location?
† KMXD † - Evil Duck Overlord, bent on world domination. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 04:43 PM |
| I tried the second one. The new location was RaidStorm1. |
|
|
| Report Abuse |
|
|
bourlo
|
  |
| Joined: 11 Aug 2009 |
| Total Posts: 399 |
|
|
| 29 Jul 2012 04:44 PM |
| you need to use the full name game.Workspace.RaidStorm1 or something |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 04:51 PM |
| Do I need to change 'location' to 'RaidStorm1' as well as changing 'Workspace' to 'RaidStorm1'? Or do I change 'Workspace' to 'game.Workspace.RaidStorm1'? Sorry, I'm really confused. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 04:52 PM |
No, as Bourlo stated, you need tell it where it is.
function color(location, color1, color2) for i, v in pairs(location:GetChildren()) do if v:IsA("BasePart") and v.BrickColor == BrickColor.new(color1) then v.BrickColor = BrickColor.new(color2) end end end color(Workspace.RaidStorm1, "Magenta", "Bright red") --It is in Workspace right?
† KMXD † - Evil Duck Overlord, bent on world domination. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 04:54 PM |
| Ok, and where it says 'location', do I change that too, or does that stay the same? |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 04:55 PM |
No, don't change it.
† KMXD † - Evil Duck Overlord, bent on world domination. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 04:56 PM |
I should have just stated, the bottom line is all you had to edit, the rest was the function I made to do everything.
† KMXD † - Evil Duck Overlord, bent on world domination. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 04:57 PM |
| Thanks, you just saved me hours of work :3 |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 05:03 PM |
No problem. :P
† KMXD † - Evil Duck Overlord, bent on world domination. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 06:03 PM |
| If I want to change something in Lighting, do I just replace Workspace with Lighting? |
|
|
| Report Abuse |
|
|