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

How to make Brickcolor to Color3?

Asked by
Aepeus 59
7 years ago

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

Log in to vote
2
Answered by 7 years ago

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!

0
You were right thanks! For some reason had to change team.Color to team Aepeus 59 — 7y
0
You just need team as you have got the Color from the Brickcolor. User#5423 17 — 7y
Ad

Answer this question