Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Text wont change on brickcolor name?

I was making some customizer for fun, but the hair will change color, and the text won't change to the brickcolor's name?

local hair = game.Workspace.NPC.Hair.Handle
local haircolor = hair.BrickColor.Name
local value = game.Workspace.Wood.ColorName
local hairtext = game.Workspace.Wood.SurfaceGui.Frame.Hair
script.Parent.MouseButton1Click:connect(function()
value.Value = haircolor
hairtext.Text = value.Value
hair.BrickColor = BrickColor.Random()
value.Value = haircolor
hairtext.Text = value.Value
end)

1 comment

0

try removing .Name from line two, i believe it should be just brickcolor

1 answer

I think you problem is in line 2. A property of a part doesn't have a name. If you just leave it as hair.BrickColor then it'd be using the part's brickColor which is what you want. Also, in line 6 and 9 if you had changed line 2 to what I've said, then value.Value would be a BrickColor value.

4 comments

0

Workspace.Wood.SurfaceGui.Frame.Left1.Script:6: bad argument #3 to 'Value' (string expected, got BrickColor)

0

In line 3, did you use a stringvalue object instead of a brickcolorvalue object for ColorName?

0

I think so

0

try changing that stringvalue object into a brickcolorvalue object.

This discussion is preserved as it was. New answers, comments, and votes are closed.