|
| 29 Jul 2015 09:07 PM |
Is it possible for me to do something that will recolor everything in my game that is a certain color, and make it another?
I have a game and it's colored blue and I want to change all the blue to a different color without individually changing it all.
It is all the same color blue. |
|
|
| Report Abuse |
|
|
TY909rox
|
  |
| Joined: 25 Apr 2011 |
| Total Posts: 28912 |
|
|
| 29 Jul 2015 09:09 PM |
| Select all, then go to color and color it |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2015 09:11 PM |
That would color everything though.
It's a fort. Some of it is gray, some is blue.
I want to make the blue into purple, but keep the gray as it is. |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Jul 2015 09:12 PM |
| @Miller - Can you elaborate? |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Jul 2015 09:13 PM |
| ye its possible mouse over only the bricks u want then choose the color u want |
|
|
| Report Abuse |
|
|
EdonSolo
|
  |
| Joined: 20 Dec 2010 |
| Total Posts: 753 |
|
| |
|
|
| 29 Jul 2015 09:16 PM |
Bricks = script.Parent:GetChildren() -- Make sure that all the bricks are here.
for i=1,#Bricks do if Bricks[i].BrickColor == BrickColor.new("Bright blue") then -- Color that it is. Bricks[i].BrickColor = BrickColor.new("Magenta") -- Color you want it to be. end end
|
|
|
| Report Abuse |
|
|
|
| 29 Jul 2015 09:17 PM |
| oldColor = "Black" newColor = "Institutional white" for i, v in pairs(workspace:GetChildren()) do if (v:IsA("BasePart") and (v.BrickColor == BrickColor.new(oldColor)) then v.BrickColor = BrickColor.new(newColor) end end |
|
|
| Report Abuse |
|
|
L2000
|
  |
| Joined: 03 Apr 2008 |
| Total Posts: 77448 |
|
|
| 29 Jul 2015 09:21 PM |
Above two ^ wouldn't really work If you have it all grouped together as different models they won't be found
Instead use this
local from = BrickColor.new("Bright blue") local to = BrickColor.new("Bright purple")
function check(par) for i,v in pairs(par:GetChildren()) do if (v:IsA("Part") and v.BrickColor == from) then v.BrickColor = to end check(v) end end
check(workspace)
Change from and to
cats r lyf |
|
|
| Report Abuse |
|
|
| |
|
L2000
|
  |
| Joined: 03 Apr 2008 |
| Total Posts: 77448 |
|
|
| 29 Jul 2015 09:25 PM |
Why would it break? ^
cats r lyf |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2015 09:26 PM |
Time to try them all!
Thanks guys. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2015 09:28 PM |
@L2 Yeah, why wouldn't he group them together? Because with yours any brick of that color will be changed.
Yeah, you're zoed. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2015 09:29 PM |
| The next question is, how do I start the script once I made it? |
|
|
| Report Abuse |
|
|
L2000
|
  |
| Joined: 03 Apr 2008 |
| Total Posts: 77448 |
|
|
| 29 Jul 2015 09:30 PM |
Yes exactly
"recolor everything in my game" > everything
cats r lyf |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Jul 2015 09:31 PM |
L2K's worked like a charm.
Thanks! |
|
|
| Report Abuse |
|
|
L2000
|
  |
| Joined: 03 Apr 2008 |
| Total Posts: 77448 |
|
|
| 29 Jul 2015 09:31 PM |
If you're in Edit mode, the top bar should have a Play button (Either green or blue, blue will have a character on it)
If its blue click beneath and then click the green one If its green click that
Then the script will run
If its not edit mode / already running highlight the script and check Disabled in properties, then uncheck
cats r lyf |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2015 09:35 PM |
@op
ya keep using his and enjoy ur broken game soon! |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2015 09:36 PM |
@Zom - I really know nothing about scripting and game building.
How is it going to break? |
|
|
| Report Abuse |
|
|
lostend
|
  |
| Joined: 21 Aug 2011 |
| Total Posts: 8265 |
|
|
| 29 Jul 2015 09:37 PM |
put this in command bar
local scan=function(w,color) for i,v in next,w:GetChildren() do if tostring(v.BrickColor):lower():match('blue') then v.BrickColor=color if #v:GetChildren()>0 then scan(v) end end end end
scan(workspace,BrickColor.new('Magenta')) |
|
|
| Report Abuse |
|
|
L2000
|
  |
| Joined: 03 Apr 2008 |
| Total Posts: 77448 |
|
|
| 29 Jul 2015 09:38 PM |
I suppose its possible that if u get like a billion models it'll have a stack overflow But like even if u go up to like 5k models nothing would rlly happen
cats r lyf |
|
|
| Report Abuse |
|
|