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

Help with Name and BrickColor?

wait(1)
for i,v in pairs(script.Parent:GetChildren()) do
	if v.ClassName == "TextButton" then
		v.MouseButton1Click:connect(function()
			script.Parent.Parent.Parent.Parent.Parent.Parent.DropColor.Value = v.Name
		end)
	end
end

I get an error that says that at line 5 it got a Name while it was expecting a BrickColor, however the Name is the name of a BrickColor... Is there anyway to convert it?

1 answer

You need to create a new brickcolor out of the name of the textbutton:

script.Parent.Parent.Parent.Parent.Parent.Parent.DropColor.Value = BrickColor.new(v.Name)

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