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: BrickColor not changing?

Previous Thread :: Next Thread 
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
25 Apr 2016 09:54 PM
local Color = Instance.new("String Value")
Color.Value = "Bright green"

game.Workspace.Part.BrickColor = BrickColor.new(Color.Value)

Is pretty much what I'm trying to do but does nothing.It will print "Bright green" but won't change the brick's color.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
25 Apr 2016 10:04 PM
b

haaaalp
Report Abuse
unroot is not online. unroot
Joined: 18 Sep 2009
Total Posts: 1114
25 Apr 2016 10:06 PM
Try Instance.new("StringValue"), although I'm not entirely sure if that will effect it.
Other than that I don't really know, that's weird..


#code print("yolo" .. string.rep("o", math.huge))
Report Abuse
CosmicPigeon is not online. CosmicPigeon
Joined: 14 Oct 2012
Total Posts: 5978
25 Apr 2016 10:06 PM
do


script.Parent.BrickColor = BrickColor.new("color here")



#code 'dumbness found'
Report Abuse
TheBenSquare is not online. TheBenSquare
Joined: 13 Dec 2009
Total Posts: 13604
25 Apr 2016 10:07 PM
Assuming that this is a copy/paste and not a rewritten version, there shouldn't be a space when you're creating it.

local Color = Instance.new("StringValue")
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
25 Apr 2016 10:11 PM
Yeah it's rewritten, my bad on the space.

What I'm trying to do is set the brickcolor of a brick that gets cloned into and welded onto player.Character. The player has a saved string value called HairColor and sets the brickcolor of the hair brick to that color...full code if anyone's interested:

CloneModule.Hair(char, "Hair1", Hair1.Value) -- ignore this its a module function
CloneModule.Hair(char, "Hair2", Hair2.Value)-- ignore this its a module function
print 'gave hair'
char:FindFirstChild("Hair1").BrickColor = BrickColor.new(HairColor.Value) --// string to brickcolor
char:FindFirstChild("Hair2").BrickColor = BrickColor.new(HairColor.Value) --// string to brickcolor
print(BrickColor.new(HairColor.Value))
print 'colored hair'


----------
Everything prints fine but it doesn't set the brickcolor

print(BrickColor.new(HairColor.Value)) -- would print "Mauve" if the stringvalue's value was "Mauve"


Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
25 Apr 2016 10:17 PM
b ;-;
Report Abuse
TheBenSquare is not online. TheBenSquare
Joined: 13 Dec 2009
Total Posts: 13604
25 Apr 2016 10:22 PM
The only thing that I can think of is that the part isnt there. It could be because the script is simply doing it before the part is added/welded. Add a check prior to and after you set the color to see if the part is there or not.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
25 Apr 2016 10:24 PM
FindFirstChild would error if it wasn't there. I'll try WaitForChild
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
25 Apr 2016 10:32 PM
nope. it goes through but still doesnt change color ugh
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
25 Apr 2016 10:37 PM
anyone...
Report Abuse
TheBenSquare is not online. TheBenSquare
Joined: 13 Dec 2009
Total Posts: 13604
25 Apr 2016 10:41 PM
Are there any other scripts that may be changing the color of the brick or deleting it upon a change and then immediately re-adding it?
Report Abuse
The_Countess is not online. The_Countess
Joined: 10 Feb 2012
Total Posts: 430
25 Apr 2016 10:43 PM
Sorry if this is a stupid question but is this a mesh on a brick or is this a brick??


|~Cherry Studios~|
Report Abuse
scottmike0 is not online. scottmike0
Joined: 14 Sep 2008
Total Posts: 1073
26 Apr 2016 12:16 AM
Look at Colors.
Report Abuse
Nicollye7074 is not online. Nicollye7074
Joined: 15 Feb 2014
Total Posts: 198
26 Apr 2016 12:58 AM
local Color = Instance.new("StringValue")
Color.Value = "Bright Green"

game.Workspace.Part.BrickColor = BrickColor.new(Color.Value)
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
26 Apr 2016 01:17 AM
lol

local Color = Instance.new("StringValue",workspace) *


Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
26 Apr 2016 05:26 AM
@time
Read my other post with code, I'm grabbing the value correctly
@The_Countess
It's a brick with a specialmesh inside it for the hair but the textureId is empty so it should change color based on the BrickColor of the brick

@The_Ben
No. In the character customization when it adds/removes hats and colors them it works fine. But that's in a localscript. I'm doing all this from a serverscript which is apparently causing problems but when I manually change BrickColor from server log it will change it
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
26 Apr 2016 05:32 AM
"Read my other post with code, I'm grabbing the value correctly"
Don't worry about TimeTicks, he posts stuff without understanding it very well. I thought he used to do better. Maybe it was just me. Maybe he gave his account away. Who even knows?

I don't see a problem. If there's no output, then it's a logic error. I don't know how to solve this, I've looked through the code you posted. :c
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
26 Apr 2016 05:50 AM
Eugh. Changing it all from (HairColor.Value) to "Bright red" doesn't even do anything. I'll prob necrobump when I get home later if I don't find a solution >.>
Report Abuse
Silicti is not online. Silicti
Joined: 07 Nov 2012
Total Posts: 8242
26 Apr 2016 07:22 AM
i dont think you can use stringvalues as brickcolors

i could be wrong
Report Abuse
Mapelman9322 is not online. Mapelman9322
Joined: 21 Jun 2013
Total Posts: 873
26 Apr 2016 07:53 AM
local Color = Instance.new("BrickColorValue") --you had "String Value" before, it's called "StringValue" with no space

Color.Value = "Bright green"

game.Workspace.Part.BrickColor = Color.Value


Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
26 Apr 2016 09:47 PM
You can if you do BrickColor.new(stringvalue) like I did...

"@The_Ben
No. In the character customization when it adds/removes hats and colors them it works fine. But that's in a localscript. I'm doing all this from a serverscript which is apparently causing problems but when I manually change BrickColor from server log it will change it" [2]


Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
26 Apr 2016 09:59 PM
Do you really need this? They are workarounds that aren't' the best but work. You could use the workaround until you find a good solution.

For example

If Color.Value == "Red" then
Hair.BrickColor = BrickColor.new("ActualBrickColor")
end
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
26 Apr 2016 10:00 PM
I'd have to account for like 32 colors but like I said even when setting the brickcolor directly like

"Changing it all from (HairColor.Value) to "Bright red" doesn't even do anything"

it didn't work


Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
26 Apr 2016 10:02 PM
Oh that's strange. Is it only for that Part/Hair, have you tried it on other bricks? Might be a mesh problem
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