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

[SOLVED] Get Color3 from a BrickColor?

Asked by 4 years ago
Edited 4 years ago

Hello all, I have a script which controls the player's hud, and in a certain section, there's a team indicator, and I want the textcolor of it to match the team color. Problem being, I'm met with an error which reads;

Player.PlayerGui.ClientEffects:53: bad argument #3 (Color3 expected, got BrickColor)

Here's a snippet of my code, if necessary. Will edit if more context is needed.

local Player = game.Players.LocalPlayer
local UI = script.Parent:WaitForChild("UI")
local roundInfo = UI:WaitForChild("RoundInfo")
local hp = UI:WaitForChild("Health")

game:GetService("RunService").RenderStepped:Connect(function()
    if roundInfo.Team.Text ~= Player.Team.Name then
        roundInfo.Team.Text = Player.Team.Name
        roundInfo.Team.TextColor3 = Player.TeamColor-- <My problem
    end
end)

Any and all help is greatly appreciated, thanks in advance!

Answer

1
TeamColor.Color will return Color3 value of the BrickColor. https://developer.roblox.com/en-us/api-reference/datatype/BrickColor (sorry, there is no page about it :b ) Block_manvn 395 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
roundInfo.Team.TextColor3.new(R,G,B)

Im not a pro at scripting so if I said something wrong correct me

Ad

Answer this question