--// variables //-- local gui = game:GetService("ServerStorage"):WaitForChild("BillboardGui") game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) if char.Head:FindFirstChild("BillboardGui") then print("BillboardGui is already inserted") else local clone = gui:Clone() clone.frame.name.Text = player.Name clone.frame.name.TextColor3 = BrickColor.new(player.TeamColor).Color clone.Parent = game.Workspace:WaitForChild(player.Name).Head end end) end)
ServerScriptService.Script:11: bad argument #1 (Color3 expected, got BrickColor) I did what most answers said to do, but it isn't working.
I don't think that there is a way to do this, but you don't need to change it to BrickColor
. Just use Color3.fromRGB
like in your previous post. Also, remove .Color
on line 11. player.TeamColor
is already an RGB colour.
This is what your script should look like:
--// variables //-- local gui = game:GetService("ServerStorage"):WaitForChild("BillboardGui") game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) if char.Head:FindFirstChild("BillboardGui") then print("BillboardGui is already inserted") else local clone = gui:Clone() clone.frame.name.Text = player.Name clone.frame.name.TextColor3 = Color3.fromRGB(player.TeamColor) clone.Parent = game.Workspace:WaitForChild(player.Name).Head end end) end)
Hope this helps!