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

How to do BrickColor value to a String value?

I need to somehow convert a BrickColor value into a String to use this:

local db = false
script.Parent.MouseButton1Click:connect(function(click)
	if db == false then
		db = true
		local team = script.Parent.Parent.Parent.Parent.Parent.Parent.TeamColor
		local unit = game.ServerStorage["Sword AI"]:Clone()
		unit.Owner.Value = script.Parent.Parent.Parent.Parent.Parent.Parent.Name
		unit:SetPrimaryPartCFrame(game.Workspace[team].SpawnPart.CFrame)
		wait(0.75)
		unit.Parent = game.Workspace.NPCs
		wait(3)
		db = false
	end
end)

2 comments

4

BrickColors have a .Name property to them. Examples; print(BrickColor.Red().Name), print(BrickColor.Blue().Name), print(BrickColor.new('Dark stone grey').Name)

1

Ty!!1!

1 answer

Well, while we now know that BrickColor has the .Name property to it, we can place this script into a brick and look at the output.

local part = script.Parent.BrickColor

print(part.Name)

put that Inside the part which you want and you will have the Name(or String) of the brickcolor.

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