It's located in Starterpack!
local player = game.Players.LocalPlayer local C = '"' .. player.TeamColor .. '"' -- the error is here! local torso = player.Character:FindFirstChild("Torso") local head = player.Character:FindFirstChild("Head") local larm = player.Character:FindFirstChild("Left Arm") local rarm = player.Character:FindFirstChild("Right Arm") local lleg = player.Character:FindFirstChild("Left Leg") local rleg = player.Character:FindFirstChild("Right Leg") torso.BrickColor = BrickColor.new(C) head.BrickColor = BrickColor.new(C) larm.BrickColor = BrickColor.new(C) rarm.BrickColor = BrickColor.new(C) lleg.BrickColor = BrickColor.new(C) rleg.BrickColor = BrickColor.new(C)
The error was because you were trying to concatenate a player's TeamColor (a BrickColor Value) into a string which doesn't make sense. What you were trying to do is concatenate the Name of the color into the string. You wouldn't have needed the extra quotes either. Quotation marks ( '', "", [[]] ) denote a string in Lua. Anyway, all you needed to say was C = player.TeamColor
and that way you don't need to use BrickColor.new(C)
because C
is already a BrickColor value.
local player = game.Players.LocalPlayer local C = player.TeamColor -- a BrickColor value local torso = player.Character:FindFirstChild("Torso") local head = player.Character:FindFirstChild("Head") local larm = player.Character:FindFirstChild("Left Arm") local rarm = player.Character:FindFirstChild("Right Arm") local lleg = player.Character:FindFirstChild("Left Leg") local rleg = player.Character:FindFirstChild("Right Leg") torso.BrickColor = C -- Setting BrickColors of all these parts to a BrickColor value (makes sense, right?) head.BrickColor = C larm.BrickColor = C rarm.BrickColor = C lleg.BrickColor = C rleg.BrickColor = C