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

How to make Brickcolor to Color3?

I am trying to make a script that shows the color of your team as a gui.

while true do
	wait(.1)
	local player = script.Parent.Parent.Parent.Parent.Parent
	local team = player.TeamColor.Color
	print(team)
	script.Parent.BackgroundColor3 = Color3.new(team)
end

The output of print is 0.768628, 0.156863, 0.109804 and when i replace it with team on 'script.Parent.BackgroundColor3 = Color3.new(team)' it works, why doesnt it work with team?

1 answer

✓ Accepted answer

To fix this, you can just remove the Color3.new constructor, as you already obtained the Color3 equivalent of the players teamcolor with the .Color property. Fixed code:

while true do
    wait(.1)
    local player = script.Parent.Parent.Parent.Parent.Parent
    local team = player.TeamColor.Color
    print(team)
    script.Parent.BackgroundColor3 = team.Color
end

If this helped, please be sure to accept this answer!

2 comments

0

You were right thanks! For some reason had to change team.Color to team

0

You just need team as you have got the Color from the Brickcolor.

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