Getting individual color values from team.GetColor(ply:team())

What I want to achieve: As you get closer to a player, their name fades in. That’s it.

What the problem is: Everything else fades normally, that’s no problem. My issue is with the teams. Players, when they speak or when you view them normally, have colored text matching their team color. I need to extract that information easily into four separate numbers: R, G, B, and A.

What I tried:


local r, g, b, a = team.GetColor(ply:Team())

When I try to use any of those variables, they come out as tables that are always changing, and not individual numbers.

Can anyone help? This is for tweaking DarkRP, by the way.

Any help with this would be greatly appreciated. Thank you!


local col = team.GetColor(ply:Team())
local r, g, b, a = col.r, col.g, col.b, col.a

Awesome, thanks a lot! :slight_smile:

To be honest, you don’t need the local variables r, g, b and a. You could just use col.r instead of r etc.