|
| 07 Jun 2015 03:28 AM |
that turns all of one material of a certain color into another material of another color, in the whole game.
This is to not LITERALLY take weeks manually changing the material and color of everything.. qq
So, can it be done? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 07 Jun 2015 03:30 AM |
local a;
a = function(b) if b:IsA("BasePart") and b.BrickColor.Name == "Old Color" and b.Material.Name == "Old Material" then b.BrickColor = BrickColor.new("New Color"); b.Material = "New Material"; end for c, d in next, b:GetChildren() do a(d); end end;
Not the best way, but who cares since you are probably only going to do this once. |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Jun 2015 04:56 AM |
| You can program a plugin to do the dirty work for you |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2015 05:57 AM |
But then you have to do the dirty work of making the plugin.
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2015 06:24 PM |
Hm... the script doesn't seem to be working... I placed the coding into the script, adjusted it to change what I needed to change, and nothing happens when I try running the game.
Anything I'm doing wrong, or am forgetting to do? |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 07 Jun 2015 06:42 PM |
function changeStuff(parent) for i,v in next, parent:getChildren() do if child:IsA("BasePart") and child.Material == "Slate" and child.BrickColor.Name == "Really red" then child.BrickColor = BrickColor.new("Bright red") child.Material = "Brick" elseif child:IsA("Model") then changeStuff(child) end end end changeStuff(game.Workspace)
________________________________
Change the values to fit your situation. |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2015 06:50 PM |
Thanks.
So, do I just put it all in a script, adjust the values, and then run the game, or...? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 07 Jun 2015 06:52 PM |
| Oh sorry you had to do: a(workspace) |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
| |
|
|
| 07 Jun 2015 06:57 PM |
like this?
local a(workspace);
a = function(b) if b:IsA("BasePart") and b.BrickColor.Name == "Really black" and b.Material.Name == "Plastic" then b.BrickColor = BrickColor.new("Dark stone grey"); b.Material = "Cobblestone"; end for c, d in next, b:GetChildren() do a(d); end end; |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 07 Jun 2015 07:00 PM |
No, just a(workspace); at the BOTTOM
a = function(b) if b:IsA("BasePart") and b ~= workspace.Terrain and b.BrickColor.Name == "Really black" and b.Material.Name == "Plastic" then b.BrickColor = BrickColor.new("Dark stone grey"); b.Material = "Cobblestone"; end for c, d in next, b:GetChildren() do a(d); end end;
a(workspace); |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 07 Jun 2015 07:01 PM |
| Yes. However, if you are changing EVERYTHING, as in, you want to look through a model's parts to find it's parts, I suggest you use mine, as it loops through the models too. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 07 Jun 2015 07:06 PM |
| Mine loops through everything, models included too. |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2015 07:07 PM |
IT WOOOOORRKKKEED< YYEESSSSSSSS
TY BOTH SO MUCH.
My first two children will be named after your usernames. |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 07 Jun 2015 07:08 PM |
| Oh yes, it does. I read it wrong :/ |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
| |
|