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

How to do BrickColor value to a String value?

Asked by
lucas4114 607 Moderation Voter
8 years ago

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)
4
BrickColors have a .Name property to them. Examples; print(BrickColor.Red().Name), print(BrickColor.Blue().Name), print(BrickColor.new('Dark stone grey').Name) M39a9am3R 3210 — 8y
1
Ty!!1! lucas4114 607 — 8y

1 answer

Log in to vote
5
Answered by
IcyEvil 260 Moderation Voter
8 years ago
Edited 6 years ago

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.

Ad

Answer this question