Brickcolor changing after converting to brickcolor?

I’m getting a brickcolor from a string and then using that to set it to the team color, but my issue is it gets the right color and then as soon as I set it to a brick color it changes from “Really red” to “Really black”

  1. I get Really red from a string in the group description
  2. I combine the strings Really and red
  3. It returns Really black?

why does this get the color right at first (really red) and then turn it into really black when i convert it to an actual brickcolor?

local bcolor1 = group.Description:match("Color: (%a+)")
local bcolor2, bcolor3 = group.Description:match("Color: (%a+) (%a+)")
            
local Team = Instance.new("Team")
Team.Name = group.Name
        
-- prints really red    
print(bcolor2)
print(bcolor3)
            
if bcolor1 ~= nil then
    if bcolor3 ~= nil then
        -- prints really black?
        print(tostring(BrickColor.new(bcolor2, bcolor3)))
        Team.TeamColor = BrickColor.new(bcolor2, bcolor3)
    else
        Team.TeamColor = BrickColor.new(bcolor1)
    end
else
    Team.TeamColor = BrickColor.random()
end

image

This is the problem of your script. BrickColor.new only requires 1 argument, but you’re providing 2 arguments. Since BrickColor.new is only taking “Really” as an argument, it is considered incomplete.

Try merging both of the 2 strings instead:

print(tostring(BrickColor.new(bcolor2 .. " " .. bcolor3)))

I have attempted this and it still returns Really black, I believe I need to find a better way to combine the strings.

Are you sure? It seems to work fine for me.
image

EDIT Try removing tostring.

print(BrickColor.new(bcolor2 .. " " .. bcolor3))

It actually worked now thats so odd thanks.

1 Like