-- Now with exciting TeamColors HACK!
--[[script.Parent:WaitForChild("Torso")
script.Parent:WaitForChild("HumanoidRootPart")
script.Parent:WaitForChild("Right Leg")
script.Parent:WaitForChild("Left Leg")
script.Parent:WaitForChild("Left Arm")
script.Parent:WaitForChild("Right Arm")
script.Parent:WaitForChild("Head")

local sp = script.Parent
local torso = script.Parent.Torso


local nName = "Neck"
local n = Instance.new("Motor6D")
n.Name = nName
n.Part0 = torso
n.Part1 = sp["Head"]
n.C0 = script[nName].C0
n.C1 = script[nName].C1
n.MaxVelocity = 0.1
local nOld = torso:FindFirstChild(nName)
n.Parent = torso
if nOld ~= nil then nOld:Destroy() end


local jName = "RootJoint"
local j = Instance.new("Motor6D")
j.Name = jName
j.Part0 = sp.HumanoidRootPart
j.Part1 = sp["Torso"]
j.C0 = script[jName].C0
j.C1 = script[jName].C1
j.MaxVelocity = 0.1
local jOld = sp.HumanoidRootPart:FindFirstChild(jName)
j.Parent = sp.HumanoidRootPart
if jOld ~= nil then jOld:Destroy() end


local rsName = "Right Shoulder"
local rs = Instance.new("Motor6D")
rs.Name = rsName
rs.Part0 = torso
rs.Part1 = sp["Right Arm"]
rs.C0 = script[rsName].C0
rs.C1 = script[rsName].C1
rs.MaxVelocity = 0.1
local rsOld = torso:FindFirstChild(rsName)
rs.Parent = torso
if rsOld ~= nil then rsOld:Destroy() end


local lsName = "Left Shoulder"
local ls = Instance.new("Motor6D")
ls.Name = lsName
ls.Part0 = torso
ls.Part1 = sp["Left Arm"]
ls.C0 = script[lsName].C0
ls.C1 = script[lsName].C1
ls.MaxVelocity = 0.1
local lsOld = torso:FindFirstChild(lsName)
ls.Parent = torso
if lsOld ~= nil then lsOld:Destroy() end

local rhName = "Right Hip"
local rh = Instance.new("Motor6D")
rh.Name = rhName
rh.Part0 = torso
rh.Part1 = sp["Right Leg"]
rh.C0 = script[rhName].C0
rh.C1 = script[rhName].C1
rh.MaxVelocity = 0.1
local rhOld = torso:FindFirstChild(rhName)
rh.Parent = torso
if rhOld ~= nil then rhOld:Destroy() end
RightHip = rh

local lhName = "Left Hip"
local lh = Instance.new("Motor6D")
lh.Name = lhName
lh.Part0 = torso
lh.Part1 = sp["Left Leg"]
lh.C0 = script[lhName].C0
lh.C1 = script[lhName].C1
lh.MaxVelocity = 0.1
local lhOld = torso:FindFirstChild(lhName)
lh.Parent = torso
if lhOld ~= nil then lhOld:Destroy() end
local LeftHip = lh

script.Parent.Head:MakeJoints()

]]



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

