Body Colors is not a valid member of Model "Player"?!

I trying to change player TeamColor but is not working at all.

My Script:

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(plrchar)
		plrchar["Body Colors"].HeadColor3 = Color3.fromRGB(255, 255, 0)
		plrchar["Body Colors"].LeftArmColor3 = Color3.fromRGB(255, 255, 0)
		plrchar["Body Colors"].RightArmColor3 = Color3.fromRGB(255, 255, 0)
		plrchar["Body Colors"].LeftLegColor3 = Color3.fromRGB(85, 170, 0)
		plrchar["Body Colors"].RightLegColor3 = Color3.fromRGB(85, 170, 0)
		plrchar["Body Colors"].TorsoColor3 = plr.TeamColor
	end)
end)

1 Like

I put the Script in ServerScriptService tho!

CharacterAdded doesn’t guarantee all of the character’s children have loaded in. (it behaves quite oddly)

With that said, a quick WaitForChild statement should do the trick. Put this before you try accessing the BodyColors object:

plrchar:WaitForChild("Body Colors")
2 Likes

As Sharpie said, you should use :WaitForChild() to secure the script to find the Body Colors.

Now this statement won’t work, since Player.TeamColor returns a BrickColor value, so to fix this you will need to get its Color:

plrchar:WaitForChild("Body Colors").TorsoColor3 = plr.TeamColor.Color
2 Likes

Thanks very much! It really help me a lot! :smiley:

1 Like

Thanks you for you too! Thanks very much!