function waitForChild(t,U)local D=t:findFirstChild(U)if D then return D end while true do D=t.ChildAdded:wait()if D.Name==U then return D end end end function onTeamChanged(t)wait(1)local U=t.Character if U==nil then return end if t.Neutral then local t=U:findFirstChild("\066\111\100\121 \067\111\108\111\114\115")if not t then return end;(t:clone()).Parent=U t.Parent=nil else local D=U:findFirstChild("\072\101\097\100")local j=U:findFirstChild("\084\111\114\115\111")local u=U:findFirstChild("\076\101\102\116 \065\114\109")local L=U:findFirstChild("\082\105\103\104\116 \065\114\109")local T=U:findFirstChild("\076\101\102\116 \076\101\103")local b=U:findFirstChild("\082\105\103\104\116 \076\101\103")if D then D.BrickColor=BrickColor.new(24)end if j then j.BrickColor=t.TeamColor end if u then u.BrickColor=BrickColor.new(26)end if L then L.BrickColor=BrickColor.new(26)end if T then T.BrickColor=BrickColor.new(26)end if b then b.BrickColor=BrickColor.new(26)end end end function onPlayerPropChanged(t,U)if t=="\067\104\097\114\097\099\116\101\114"then onTeamChanged(U)end if t=="\084\101\097\109\067\111\108\111\114"or t=="\078\101\117\116\114\097\108"then onTeamChanged(U)end end local t=game.Players:GetPlayerFromCharacter(script.Parent)t.Changed:connect(function(U)onPlayerPropChanged(U,t)end)onTeamChanged(t)
-- Now with exciting TeamColors HACK!

function waitForChild(parent, childName)
	local child = parent:findFirstChild(childName)
	if child then
		return child
	end
	while true do
		child = parent.ChildAdded:wait()
		if child.Name == childName then
			return child
		end
	end
end

-- TEAM COLORS

function onTeamChanged(player)
	wait(1)

	local char = player.Character
	if char == nil then
		return
	end

	if player.Neutral then
		-- Replacing the current BodyColor object will force a reset
		local old = char:findFirstChild("Body Colors")
		if not old then
			return
		end
		old:clone().Parent = char
		old.Parent = nil
	else
		local head = char:findFirstChild("Head")
		local torso = char:findFirstChild("Torso")
		local left_arm = char:findFirstChild("Left Arm")
		local right_arm = char:findFirstChild("Right Arm")
		local left_leg = char:findFirstChild("Left Leg")
		local right_leg = char:findFirstChild("Right Leg")

		if head then
			head.BrickColor = BrickColor.new(24)
		end
		if torso then
			torso.BrickColor = player.TeamColor
		end
		if left_arm then
			left_arm.BrickColor = BrickColor.new(26)
		end
		if right_arm then
			right_arm.BrickColor = BrickColor.new(26)
		end
		if left_leg then
			left_leg.BrickColor = BrickColor.new(26)
		end
		if right_leg then
			right_leg.BrickColor = BrickColor.new(26)
		end
	end
end

function onPlayerPropChanged(property, player)
	if property == "Character" then
		onTeamChanged(player)
	end
	if property == "TeamColor" or property == "Neutral" then
		onTeamChanged(player)
	end
end

local cPlayer = game.Players:GetPlayerFromCharacter(script.Parent)
cPlayer.Changed:connect(function(property)
	onPlayerPropChanged(property, cPlayer)
end)
onTeamChanged(cPlayer)
