|
| 23 Mar 2014 09:18 AM |
| I have this huge model and I need to edit some colors individually, but they're all in a jumble. I can't really do it manually since the scrollbar is literally a square when the model is opened. What I'm asking for is something that changed the order of the bricks in a model, or puts them into several subcategories for colors. If anybody knows something that does that, please tell me. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 09:38 AM |
Colors = {} DidItHappen = true Model = PATHTOMODEL ch = Model:GetChildren() for I = 1,#ch do Color = ch[I].BrickColor for I = 1,#Colors do if Colors[I] == Color then DidItHappen = false end end if DidItHappen == true then M = Instance.new("Model", Model) M.Name = Color elseif DidItHappen == false then ch[I].Parent = Model:FindFirstChild(Color) end end
Test that, try it. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 09:47 AM |
Or...
Colors = {} ColorExists = false Model = PATHTOMODEL ch = Model:GetChildren() for I = 1,#ch do ch[I].Name = ch[I].BrickColor end for I = 1,#ch do for O = 1,#Colors do if Model:FindFirstChild(Colors[O]) then ColorExists = true end if ColorExists == true then ch[I].Parent = Model[ch.Name] elseif ColorExists == false then M = Instance.new("Model", Model) M.Name = ch[ch.Name] ch[I].Parent = M end end end
Try that one first. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 10:35 AM |
| It doesn't work, I tried them both and nothing happens to the model at all. |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Mar 2014 11:25 AM |
| Yes, I put it in Workspace, completed the model path and tried the color list with both color codes and names. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 11:40 AM |
| The second should have worked. Sorry. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 11:42 AM |
| It's alright, I'll see if there's something I can do or if I can figure out why it doesn't work but I'm not that good with scripts. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 11:51 AM |
Lemme try something else
Model = PATHTOMODEL C = Model:GetChildren() print("Success 1.") for I = 1,#C do C[I].Name = C[I].BrickColor end print("Success 2.") Model = PATHTOMODEL C = Model:GetChildren() print("Success 3.") A = 0 for I = 1,#C do if Model:FindFirstChild(C[I].Name) then C[I].Parent = Model[C[I].Name] A = I + 3 print("Success ".. A ..".") else M = Instance.new("Model", Model) M.Name = C[I].Name C[I].Parent = M print("Success ".. I + A ..".") end end print("Conplete Success!")
Tell me what number it makes it too! |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 11:53 AM |
Sorry that wouldn't work
Lemme try something else
Model = PATHTOMODEL C = Model:GetChildren() print("Success 1.") for I = 1,#C do C[I].Name = C[I].BrickColor end print("Success 2.") Model = PATHTOMODEL C = Model:GetChildren() print("Success 3.") A = 3 for I = 1,#C do if Model:FindFirstChild(C[I].Name) then C[I].Parent = Model[C[I].Name] A = I + A print("Success ".. A ..".") else M = Instance.new("Model", Model) M.Name = C[I].Name C[I].Parent = M print("Success ".. I + A ..".") end end print("Conplete Success!")
Tell me what number it makes it too!
|
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 12:18 PM |
| I only had Success 1 in output |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 12:31 PM |
| I found the error, but I have no idea how to fix it. You can set the models name to its color, I suppose that's kind of obvious... |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 01:02 PM |
| The issue is that the model has a whole lot of colors, but I'll see what I can do about changing them manually. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 01:47 PM |
| No, that's not it. I need to turn the BrickColor into a string... |
|
|
| Report Abuse |
|
|