Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Text wont change on brickcolor name?

Asked by
yoshi8080 445 Moderation Voter
9 years ago

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)
0
try removing .Name from line two, i believe it should be just brickcolor pluginfactory 463 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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.

0
Workspace.Wood.SurfaceGui.Frame.Left1.Script:6: bad argument #3 to 'Value' (string expected, got BrickColor) yoshi8080 445 — 9y
0
In line 3, did you use a stringvalue object instead of a brickcolorvalue object for ColorName? TerraSky 5 — 9y
0
I think so yoshi8080 445 — 9y
0
try changing that stringvalue object into a brickcolorvalue object. TerraSky 5 — 9y
Ad

Answer this question